2014-02-06 06:34:46 +04:00
|
|
|
/*
|
2016-03-24 22:08:51 +03:00
|
|
|
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
|
2014-02-06 06:34:46 +04:00
|
|
|
*
|
2016-03-24 22:08:51 +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_READER_H_
|
|
|
|
#define VIDEO_READER_H_
|
|
|
|
|
|
|
|
#include "./video_common.h"
|
|
|
|
|
|
|
|
// The following code is work in progress. It is going to support transparent
|
|
|
|
// reading of input files. Right now only IVF format is supported for
|
|
|
|
// simplicity. The main goal the API is to be simple and easy to use in example
|
2016-03-25 22:11:05 +03:00
|
|
|
// code and in aomenc/aomdec later. All low-level details like memory
|
2014-02-06 06:34:46 +04:00
|
|
|
// buffer management are hidden from API users.
|
2016-03-30 00:27:56 +03:00
|
|
|
struct AvxVideoReaderStruct;
|
|
|
|
typedef struct AvxVideoReaderStruct AvxVideoReader;
|
2014-02-06 06:34:46 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Opens the input file for reading and inspects it to determine file type.
|
2016-03-30 00:27:56 +03:00
|
|
|
// Returns an opaque AvxVideoReader* upon success, or NULL upon failure.
|
2014-02-06 06:34:46 +04:00
|
|
|
// Right now only IVF format is supported.
|
2016-03-30 00:27:56 +03:00
|
|
|
AvxVideoReader *aom_video_reader_open(const char *filename);
|
2014-02-06 06:34:46 +04:00
|
|
|
|
2016-03-30 00:27:56 +03:00
|
|
|
// Frees all resources associated with AvxVideoReader* returned from
|
2016-03-25 22:11:05 +03:00
|
|
|
// aom_video_reader_open() call.
|
2016-03-30 00:27:56 +03:00
|
|
|
void aom_video_reader_close(AvxVideoReader *reader);
|
2014-02-06 06:34:46 +04:00
|
|
|
|
|
|
|
// Reads frame from the file and stores it in internal buffer.
|
2016-03-30 00:27:56 +03:00
|
|
|
int aom_video_reader_read_frame(AvxVideoReader *reader);
|
2014-02-06 06:34:46 +04:00
|
|
|
|
|
|
|
// Returns the pointer to memory buffer with frame data read by last call to
|
2016-03-25 22:11:05 +03:00
|
|
|
// aom_video_reader_read_frame().
|
2016-03-30 00:27:56 +03:00
|
|
|
const uint8_t *aom_video_reader_get_frame(AvxVideoReader *reader, size_t *size);
|
2014-02-06 06:34:46 +04:00
|
|
|
|
2016-03-30 00:27:56 +03:00
|
|
|
// Fills AvxVideoInfo with information from opened video file.
|
|
|
|
const AvxVideoInfo *aom_video_reader_get_info(AvxVideoReader *reader);
|
2014-02-06 06:34:46 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // VIDEO_READER_H_
|