2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
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.
13 #include "./tools_common.h"
19 int file_is_ivf(struct VpxInputContext *input);
21 int ivf_read_frame(FILE *infile, uint8_t **buffer,
22 size_t *bytes_read, size_t *buffer_size);
24 // The following code is work in progress. It is going to be in a separate file
25 // and support transparent reading of IVF and Y4M formats. Right now only IVF
26 // format is supported for simplicity. The main goal the API is to be
27 // simple and easy to use in example code (and probably in vpxenc/vpxdec later).
28 // All low-level details like memory buffer management are hidden from API
31 typedef struct vpx_video vpx_video_t;
33 // Opens the input file and inspects it to determine file type. Returns an
34 // opaque vpx_video_t* upon success, or NULL upon failure.
35 vpx_video_t *vpx_video_open_file(FILE *file);
37 // Frees all resources associated with vpx_video_t returned from
38 // vpx_video_open_file() call
39 void vpx_video_close(vpx_video_t *video);
41 int vpx_video_get_width(vpx_video_t *video);
42 int vpx_video_get_height(vpx_video_t *video);
43 unsigned int vpx_video_get_fourcc(vpx_video_t *video);
45 // Reads video frame bytes from the file and stores them into internal buffer.
46 int vpx_video_read_frame(vpx_video_t *video);
48 // Returns the pointer to internal memory buffer with frame bytes read from
49 // last call to vpx_video_read_frame().
50 const unsigned char *vpx_video_get_frame(vpx_video_t *video, size_t *size);