25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

43 satır
1.3KB

  1. #ifndef _mp4_file_reader_h_
  2. #define _mp4_file_reader_h_
  3. #include "vod-file-source.h"
  4. #include "mov-reader.h"
  5. #include "avpktutil.h"
  6. #include <string>
  7. #include <stdio.h>
  8. #include <stdint.h>
  9. class MP4FileReader : public VodFileSource::IFileReader
  10. {
  11. public:
  12. MP4FileReader(const char* file);
  13. virtual ~MP4FileReader();
  14. public:
  15. virtual int Read(struct avpacket_t** pkt);
  16. virtual int Seek(uint64_t* pos, int strategy);
  17. virtual uint64_t GetPosotion();
  18. virtual uint64_t GetDuration();
  19. public:
  20. int GetInfo();
  21. int GetInfo(struct mov_reader_trackinfo_t* info, void* param);
  22. private:
  23. static void OnVideoInfo(void* param, uint32_t track, uint8_t object, int width, int height, const void* extra, size_t bytes);
  24. static void OnAudioInfo(void* param, uint32_t track, uint8_t object, int channel_count, int bit_per_sample, int sample_rate, const void* extra, size_t bytes);
  25. static void OnSubtitleInfo(void* param, uint32_t track, uint8_t object, const void* extra, size_t bytes);
  26. static void MP4OnRead(void* param, uint32_t track, const void* buffer, size_t bytes, int64_t pts, int64_t dts, int flags);
  27. private:
  28. FILE* m_fp;
  29. int64_t m_pos;
  30. mov_reader_t* m_reader;
  31. struct avpacket_t** m_pkt;
  32. struct avpktutil_t m_utils;
  33. uint8_t m_packet[2 * 1024 * 1024];
  34. };
  35. #endif /* !_mp4_file_reader_h_ */