Bug 584259 - Update libnestegg. r=doublec a=roc

This commit is contained in:
Matthew Gregan 2010-11-03 12:38:04 +13:00
Родитель 537af77ca8
Коммит a44f096171
3 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
The nestegg git repository is: git://github.com/kinetiknz/nestegg.git
The git commit ID used was 0d51131519a1014660b5e111e28a78785d76600f.
The git commit ID used was ef45a1c3a6b86ce3d86d179537e94c57008f07f4.

Просмотреть файл

@ -68,6 +68,12 @@ extern "C" {
#define NESTEGG_CODEC_VP8 0 /**< Track uses Google On2 VP8 codec. */
#define NESTEGG_CODEC_VORBIS 1 /**< Track uses Xiph Vorbis codec. */
#define NESTEGG_VIDEO_MONO 0 /**< Track is mono video. */
#define NESTEGG_VIDEO_STEREO_LEFT_RIGHT 1 /**< Track is side-by-side stereo video. Left first. */
#define NESTEGG_VIDEO_STEREO_BOTTOM_TOP 2 /**< Track is top-bottom stereo video. Right first. */
#define NESTEGG_VIDEO_STEREO_TOP_BOTTOM 3 /**< Track is top-bottom stereo video. Left first. */
#define NESTEGG_VIDEO_STEREO_RIGHT_LEFT 11 /**< Track is side-by-side stereo video. Right first. */
#define NESTEGG_SEEK_SET 0 /**< Seek offset relative to beginning of stream. */
#define NESTEGG_SEEK_CUR 1 /**< Seek offset relative to current position in stream. */
#define NESTEGG_SEEK_END 2 /**< Seek offset relative to end of stream. */
@ -113,6 +119,10 @@ typedef struct {
/** Parameters specific to a video track. */
typedef struct {
unsigned int stereo_mode; /**< Video mode. One of #NESTEGG_VIDEO_MONO,
#NESTEGG_VIDEO_STEREO_LEFT_RIGHT,
#NESTEGG_VIDEO_STEREO_BOTTOM_TOP, or
#NESTEGG_VIDEO_STEREO_TOP_BOTTOM. */
unsigned int width; /**< Width of the video frame in pixels. */
unsigned int height; /**< Height of the video frame in pixels. */
unsigned int display_width; /**< Display width of the video frame in pixels. */

Просмотреть файл

@ -66,6 +66,7 @@
/* Video Elements */
#define ID_VIDEO 0xe0
#define ID_STEREO_MODE 0x53b8
#define ID_PIXEL_WIDTH 0xb0
#define ID_PIXEL_HEIGHT 0xba
#define ID_PIXEL_CROP_BOTTOM 0x54aa
@ -199,6 +200,7 @@ struct cluster {
};
struct video {
struct ebml_type stereo_mode;
struct ebml_type pixel_width;
struct ebml_type pixel_height;
struct ebml_type pixel_crop_bottom;
@ -373,6 +375,7 @@ static struct ebml_element_desc ne_cluster_elements[] = {
};
static struct ebml_element_desc ne_video_elements[] = {
E_FIELD(ID_STEREO_MODE, TYPE_UINT, struct video, stereo_mode),
E_FIELD(ID_PIXEL_WIDTH, TYPE_UINT, struct video, pixel_width),
E_FIELD(ID_PIXEL_HEIGHT, TYPE_UINT, struct video, pixel_height),
E_FIELD(ID_PIXEL_CROP_BOTTOM, TYPE_UINT, struct video, pixel_crop_bottom),
@ -1414,7 +1417,7 @@ nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback)
uint64_t id, version, docversion;
struct ebml_list_node * track;
char * doctype;
nestegg * ctx = NULL;
nestegg * ctx;
if (!(io.read && io.seek && io.tell))
return -1;
@ -1772,6 +1775,12 @@ nestegg_track_video_params(nestegg * ctx, unsigned int track,
if (nestegg_track_type(ctx, track) != NESTEGG_TRACK_VIDEO)
return -1;
value = 0;
ne_get_uint(entry->video.stereo_mode, &value);
if (value <= NESTEGG_VIDEO_STEREO_TOP_BOTTOM ||
value == NESTEGG_VIDEO_STEREO_RIGHT_LEFT)
params->stereo_mode = value;
if (ne_get_uint(entry->video.pixel_width, &value) != 0)
return -1;
params->width = value;