/src/info.h

https://code.google.com/ · C Header · 87 lines · 55 code · 9 blank · 23 comment · 0 complexity · 90d26d93d57cb8799532c2e35e569563 MD5 · raw file

  1. /*
  2. $Id: info.h 231 2011-06-27 13:46:19Z marc.noirot $
  3. FLV Metadata updater
  4. Copyright (C) 2007-2012 Marc Noirot <marc.noirot AT gmail.com>
  5. This file is part of FLVMeta.
  6. FLVMeta is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. FLVMeta is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with FLVMeta; if not, write to the Free Software
  16. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef __INFO_H__
  19. #define __INFO_H__
  20. #include "flvmeta.h"
  21. typedef struct __flv_info {
  22. flv_header header;
  23. uint8 have_video;
  24. uint8 have_audio;
  25. uint32 video_width;
  26. uint32 video_height;
  27. uint8 video_codec;
  28. uint32 video_frames_number;
  29. uint8 audio_codec;
  30. uint8 audio_size;
  31. uint8 audio_rate;
  32. uint8 audio_stereo;
  33. file_offset_t video_data_size;
  34. file_offset_t audio_data_size;
  35. file_offset_t meta_data_size;
  36. file_offset_t real_video_data_size;
  37. file_offset_t real_audio_data_size;
  38. uint32 video_first_timestamp;
  39. uint32 audio_first_timestamp;
  40. uint32 first_timestamp;
  41. uint8 can_seek_to_end;
  42. uint8 have_keyframes;
  43. uint32 last_keyframe_timestamp;
  44. uint32 on_metadata_size;
  45. file_offset_t on_metadata_offset;
  46. uint32 biggest_tag_body_size;
  47. uint32 last_timestamp;
  48. uint32 video_frame_duration;
  49. uint32 audio_frame_duration;
  50. file_offset_t total_prev_tags_size;
  51. uint8 have_on_last_second;
  52. amf_data * original_on_metadata;
  53. amf_data * keyframes;
  54. amf_data * times;
  55. amf_data * filepositions;
  56. } flv_info;
  57. typedef struct __flv_metadata {
  58. amf_data * on_last_second_name;
  59. amf_data * on_last_second;
  60. amf_data * on_metadata_name;
  61. amf_data * on_metadata;
  62. } flv_metadata;
  63. #ifdef __cplusplus
  64. extern "C" {
  65. #endif /* __cplusplus */
  66. int get_flv_info(flv_stream * flv_in, flv_info * info, const flvmeta_opts * opts);
  67. void compute_metadata(flv_info * info, flv_metadata * meta, const flvmeta_opts * opts);
  68. void compute_current_metadata(flv_info * info, flv_metadata * meta);
  69. #ifdef __cplusplus
  70. }
  71. #endif /* __cplusplus */
  72. #endif /* __INFO_H__ */