webmenc.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2013 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 WEBMENC_H_
  11. #define WEBMENC_H_
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include "tools_common.h"
  15. #include "vpx/vpx_encoder.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. struct WebmOutputContext {
  20. int debug;
  21. FILE *stream;
  22. int64_t last_pts_ns;
  23. void *writer;
  24. void *segment;
  25. };
  26. /* Stereo 3D packed frame format */
  27. typedef enum stereo_format {
  28. STEREO_FORMAT_MONO = 0,
  29. STEREO_FORMAT_LEFT_RIGHT = 1,
  30. STEREO_FORMAT_BOTTOM_TOP = 2,
  31. STEREO_FORMAT_TOP_BOTTOM = 3,
  32. STEREO_FORMAT_RIGHT_LEFT = 11
  33. } stereo_format_t;
  34. void write_webm_file_header(struct WebmOutputContext *webm_ctx,
  35. const vpx_codec_enc_cfg_t *cfg,
  36. stereo_format_t stereo_fmt, unsigned int fourcc,
  37. const struct VpxRational *par);
  38. void write_webm_block(struct WebmOutputContext *webm_ctx,
  39. const vpx_codec_enc_cfg_t *cfg,
  40. const vpx_codec_cx_pkt_t *pkt);
  41. void write_webm_file_footer(struct WebmOutputContext *webm_ctx);
  42. #ifdef __cplusplus
  43. } // extern "C"
  44. #endif
  45. #endif // WEBMENC_H_