Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: source/libvpx/ivfdec.c

Issue 168343002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: libvpx: Pull from upstream Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/ivfdec.h ('k') | source/libvpx/ivfenc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/ivfdec.c
===================================================================
--- source/libvpx/ivfdec.c (revision 251189)
+++ source/libvpx/ivfdec.c (working copy)
@@ -108,68 +108,3 @@
return 1;
}
-
-struct vpx_video {
- FILE *file;
- unsigned char *buffer;
- size_t buffer_size;
- size_t frame_size;
- unsigned int fourcc;
- int width;
- int height;
-};
-
-vpx_video_t *vpx_video_open_file(FILE *file) {
- char raw_hdr[32];
- vpx_video_t *video;
-
- if (fread(raw_hdr, 1, 32, file) != 32)
- return NULL; // Can't read file header;
-
- if (memcmp(IVF_SIGNATURE, raw_hdr, 4) != 0)
- return NULL; // Wrong IVF signature
-
- if (mem_get_le16(raw_hdr + 4) != 0)
- return NULL; // Wrong IVF version
-
- video = (vpx_video_t *)malloc(sizeof(*video));
- video->file = file;
- video->buffer = NULL;
- video->buffer_size = 0;
- video->frame_size = 0;
- video->fourcc = mem_get_le32(raw_hdr + 8);
- video->width = mem_get_le16(raw_hdr + 12);
- video->height = mem_get_le16(raw_hdr + 14);
- return video;
-}
-
-void vpx_video_close(vpx_video_t *video) {
- if (video) {
- free(video->buffer);
- free(video);
- }
-}
-
-int vpx_video_get_width(vpx_video_t *video) {
- return video->width;
-}
-
-int vpx_video_get_height(vpx_video_t *video) {
- return video->height;
-}
-
-unsigned int vpx_video_get_fourcc(vpx_video_t *video) {
- return video->fourcc;
-}
-
-int vpx_video_read_frame(vpx_video_t *video) {
- return !ivf_read_frame(video->file, &video->buffer, &video->frame_size,
- &video->buffer_size);
-}
-
-const unsigned char *vpx_video_get_frame(vpx_video_t *video, size_t *size) {
- if (size)
- *size = video->frame_size;
-
- return video->buffer;
-}
« no previous file with comments | « source/libvpx/ivfdec.h ('k') | source/libvpx/ivfenc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698