2
0

video_reader.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VPX_VIDEO_READER_H_
  11. #define VPX_VIDEO_READER_H_
  12. #include "./video_common.h"
  13. // The following code is work in progress. It is going to support transparent
  14. // reading of input files. Right now only IVF format is supported for
  15. // simplicity. The main goal the API is to be simple and easy to use in example
  16. // code and in vpxenc/vpxdec later. All low-level details like memory
  17. // buffer management are hidden from API users.
  18. struct VpxVideoReaderStruct;
  19. typedef struct VpxVideoReaderStruct VpxVideoReader;
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. // Opens the input file for reading and inspects it to determine file type.
  24. // Returns an opaque VpxVideoReader* upon success, or NULL upon failure.
  25. // Right now only IVF format is supported.
  26. VpxVideoReader *vpx_video_reader_open(const char *filename);
  27. // Frees all resources associated with VpxVideoReader* returned from
  28. // vpx_video_reader_open() call.
  29. void vpx_video_reader_close(VpxVideoReader *reader);
  30. // Reads frame from the file and stores it in internal buffer.
  31. int vpx_video_reader_read_frame(VpxVideoReader *reader);
  32. // Returns the pointer to memory buffer with frame data read by last call to
  33. // vpx_video_reader_read_frame().
  34. const uint8_t *vpx_video_reader_get_frame(VpxVideoReader *reader, size_t *size);
  35. // Fills VpxVideoInfo with information from opened video file.
  36. const VpxVideoInfo *vpx_video_reader_get_info(VpxVideoReader *reader);
  37. #ifdef __cplusplus
  38. } // extern "C"
  39. #endif
  40. #endif // VPX_VIDEO_READER_H_