2014-02-06 06:34:46 +04:00
|
|
|
/*
|
2016-09-02 00:32:49 +03:00
|
|
|
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
|
2014-02-06 06:34:46 +04:00
|
|
|
*
|
2016-09-02 00:32:49 +03:00
|
|
|
* This source code is subject to the terms of the BSD 2 Clause License and
|
|
|
|
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
|
|
|
|
* was not distributed with this source code in the LICENSE file, you can
|
|
|
|
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
|
|
|
|
* Media Patent License 1.0 was not distributed with this source code in the
|
|
|
|
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
|
2014-02-06 06:34:46 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VIDEO_WRITER_H_
|
|
|
|
#define VIDEO_WRITER_H_
|
|
|
|
|
|
|
|
#include "./video_common.h"
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
typedef enum { kContainerIVF } AvxContainer;
|
2014-02-06 06:34:46 +04:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
struct AvxVideoWriterStruct;
|
|
|
|
typedef struct AvxVideoWriterStruct AvxVideoWriter;
|
2014-02-06 06:34:46 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Finds and opens writer for specified container format.
|
2016-08-31 00:01:10 +03:00
|
|
|
// Returns an opaque AvxVideoWriter* upon success, or NULL upon failure.
|
2014-02-06 06:34:46 +04:00
|
|
|
// Right now only IVF format is supported.
|
2016-08-31 00:01:10 +03:00
|
|
|
AvxVideoWriter *aom_video_writer_open(const char *filename,
|
|
|
|
AvxContainer container,
|
|
|
|
const AvxVideoInfo *info);
|
2014-02-06 06:34:46 +04:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
// Frees all resources associated with AvxVideoWriter* returned from
|
|
|
|
// aom_video_writer_open() call.
|
|
|
|
void aom_video_writer_close(AvxVideoWriter *writer);
|
2014-02-06 06:34:46 +04:00
|
|
|
|
|
|
|
// Writes frame bytes to the file.
|
2016-08-31 00:01:10 +03:00
|
|
|
int aom_video_writer_write_frame(AvxVideoWriter *writer, const uint8_t *buffer,
|
2016-08-09 05:03:30 +03:00
|
|
|
size_t size, int64_t pts);
|
2014-02-06 06:34:46 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // VIDEO_WRITER_H_
|