mp4_jpeg_decoder.h 1.0 KB

1234567891011121314151617181920212223242526272829
  1. #include "../Plugins/Input/in_mp4/mpeg4video.h"
  2. #include "loader_jpg.h"
  3. // {CFF4B746-8D98-48c1-BDDF-9AA750F51517}
  4. static const GUID mp4_jpeg_guid =
  5. { 0xcff4b746, 0x8d98, 0x48c1, { 0xbd, 0xdf, 0x9a, 0xa7, 0x50, 0xf5, 0x15, 0x17 } };
  6. class MP4JPEGDecoder : public MP4VideoDecoder
  7. {
  8. public:
  9. static const char *getServiceName() { return "JPEG MP4 Decoder"; }
  10. static GUID getServiceGuid() { return mp4_jpeg_guid; }
  11. MP4JPEGDecoder();
  12. int Open(MP4FileHandle mp4_file, MP4TrackId mp4_track);
  13. int GetOutputFormat(int *x, int *y, int *color_format, double *aspect_ratio);
  14. int DecodeSample(const void *inputBuffer, size_t inputBufferBytes, MP4Timestamp timestamp);
  15. void Close();
  16. int CanHandleCodec(const char *codecName);
  17. int GetPicture(void **data, void **decoder_data, MP4Timestamp *timestamp);
  18. void FreePicture(void *data, void *decoder_data);
  19. protected:
  20. RECVS_DISPATCH;
  21. private:
  22. JpgLoad *jpegLoader; // new during Open(), since we might have been created just for CanHandleCodec
  23. int width, height;
  24. void *decoded_image; // ARGB32
  25. };