video_writer.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_WRITER_H_
  11. #define VPX_VIDEO_WRITER_H_
  12. #include "./video_common.h"
  13. typedef enum { kContainerIVF } VpxContainer;
  14. struct VpxVideoWriterStruct;
  15. typedef struct VpxVideoWriterStruct VpxVideoWriter;
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. // Finds and opens writer for specified container format.
  20. // Returns an opaque VpxVideoWriter* upon success, or NULL upon failure.
  21. // Right now only IVF format is supported.
  22. VpxVideoWriter *vpx_video_writer_open(const char *filename,
  23. VpxContainer container,
  24. const VpxVideoInfo *info);
  25. // Frees all resources associated with VpxVideoWriter* returned from
  26. // vpx_video_writer_open() call.
  27. void vpx_video_writer_close(VpxVideoWriter *writer);
  28. // Writes frame bytes to the file.
  29. int vpx_video_writer_write_frame(VpxVideoWriter *writer, const uint8_t *buffer,
  30. size_t size, int64_t pts);
  31. #ifdef __cplusplus
  32. } // extern "C"
  33. #endif
  34. #endif // VPX_VIDEO_WRITER_H_