summaryrefslogtreecommitdiff
path: root/ivfdec.h
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-01-24 11:20:09 -0800
committerDmitry Kovalev <dkovalev@google.com>2014-01-24 11:20:09 -0800
commitc2b336815dddcd9fab2d4fb8ee199b816ce8c347 (patch)
treea234bd651c5637c1d02c37d663c3fc168238aa4e /ivfdec.h
parent58b9c9fbce267894b69d4521bf34349f4e557b9b (diff)
downloadlibvpx-c2b336815dddcd9fab2d4fb8ee199b816ce8c347.tar
libvpx-c2b336815dddcd9fab2d4fb8ee199b816ce8c347.tar.gz
libvpx-c2b336815dddcd9fab2d4fb8ee199b816ce8c347.tar.bz2
libvpx-c2b336815dddcd9fab2d4fb8ee199b816ce8c347.zip
Implementing simple API to read video files.
New API is supposed to be used from example code. Current implementation only supports IVF containers (will be extended to Y4M). Change-Id: Ib7da87237690b1a28297bdf03bc41c6836a84b7e
Diffstat (limited to 'ivfdec.h')
-rw-r--r--ivfdec.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/ivfdec.h b/ivfdec.h
index dd29cc617..e960b4aec 100644
--- a/ivfdec.h
+++ b/ivfdec.h
@@ -21,6 +21,34 @@ int file_is_ivf(struct VpxInputContext *input);
int ivf_read_frame(FILE *infile, uint8_t **buffer,
size_t *bytes_read, size_t *buffer_size);
+// The following code is work in progress. It is going to be in a separate file
+// and support transparent reading of IVF and Y4M formats. Right now only IVF
+// format is supported for simplicity. The main goal the API is to be
+// simple and easy to use in example code (and probably in vpxenc/vpxdec later).
+// All low-level details like memory buffer management are hidden from API
+// users.
+struct vpx_video;
+typedef struct vpx_video vpx_video_t;
+
+// Opens the input file and inspects it to determine file type. Returns an
+// opaque vpx_video_t* upon success, or NULL upon failure.
+vpx_video_t *vpx_video_open_file(FILE *file);
+
+// Frees all resources associated with vpx_video_t returned from
+// vpx_video_open_file() call
+void vpx_video_close(vpx_video_t *video);
+
+int vpx_video_get_width(vpx_video_t *video);
+int vpx_video_get_height(vpx_video_t *video);
+unsigned int vpx_video_get_fourcc(vpx_video_t *video);
+
+// Reads video frame bytes from the file and stores them into internal buffer.
+int vpx_video_read_frame(vpx_video_t *video);
+
+// Returns the pointer to internal memory buffer with frame bytes read from
+// last call to vpx_video_read_frame().
+const unsigned char *vpx_video_get_frame(vpx_video_t *video, size_t *size);
+
#ifdef __cplusplus
} /* extern "C" */
#endif