Mercurial > mplayer.hg
annotate libmpcodecs/vd_theora.c @ 10138:5e286cc6ad21
Removed YUV (YV12) and BGR support, leaving the native RGB support. Also cleaned some other parts.
author | alex |
---|---|
date | Tue, 20 May 2003 16:48:05 +0000 |
parents | 5730f6098f98 |
children | 95dc2037fb27 |
rev | line source |
---|---|
10094
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
1 #include <stdio.h> |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
2 #include <stdlib.h> |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
3 #include <stdarg.h> |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
4 #include <assert.h> |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
5 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
6 #include "config.h" |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
7 #include "mp_msg.h" |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
8 #include "help_mp.h" |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
9 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
10 #ifdef HAVE_OGGTHEORA |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
11 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
12 #include "vd_internal.h" |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
13 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
14 static vd_info_t info = { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
15 "Theora/VP3", |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
16 "theora", |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
17 "David Kuehling", |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
18 "www.theora.org", |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
19 "Theora project's VP3 codec" |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
20 }; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
21 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
22 LIBVD_EXTERN(theora) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
23 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
24 #include <theora/theora.h> |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
25 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
26 // to set/get/query special features/parameters |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
27 static int control(sh_video_t *sh,int cmd,void* arg,...){ |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
28 return CONTROL_UNKNOWN; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
29 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
30 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
31 typedef struct theora_struct_st { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
32 theora_state st; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
33 theora_info inf; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
34 } theora_struct_t; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
35 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
36 /* |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
37 * init driver |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
38 */ |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
39 static int init(sh_video_t *sh){ |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
40 theora_struct_t *context = NULL; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
41 int failed = 1; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
42 int errorCode = 0; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
43 ogg_packet op; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
44 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
45 /* check whether video output format is supported */ |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
46 switch(sh->codec->outfmt[sh->outfmtidx]) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
47 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
48 case IMGFMT_YV12: /* well, this should work... */ break; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
49 default: |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
50 mp_msg (MSGT_DECVIDEO,MSGL_ERR,"Unsupported out_fmt: 0x%X\n", |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
51 sh->codec->outfmt[sh->outfmtidx]); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
52 return 0; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
53 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
54 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
55 /* this is not a loop, just a context, from which we can break on error */ |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
56 do |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
57 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
58 context = (theora_struct_t *)calloc (sizeof (theora_struct_t), 1); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
59 sh->context = context; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
60 if (!context) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
61 break; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
62 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
63 /* read initial header */ |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
64 op.bytes = ds_get_packet (sh->ds,&op.packet); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
65 op.b_o_s = 1; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
66 if((errorCode = theora_decode_header (&context->inf, &op))) { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
67 mp_msg(MSGT_DECAUDIO,MSGL_ERR, |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
68 "Broken Theora header; erroroCode=%i!\n", errorCode); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
69 break; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
70 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
71 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
72 errorCode = theora_decode_init (&context->st, &context->inf); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
73 if (errorCode) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
74 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
75 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Theora decode init failed: %i \n", |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
76 errorCode); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
77 break; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
78 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
79 failed = 0; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
80 } while (0); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
81 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
82 if (failed) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
83 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
84 if (context) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
85 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
86 free (context); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
87 sh->context = NULL; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
88 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
89 return 0; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
90 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
91 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
92 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Theora video init ok!\n"); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
93 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
94 return mpcodecs_config_vo (sh,sh->disp_w,sh->disp_h,IMGFMT_YV12); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
95 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
96 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
97 /* |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
98 * uninit driver |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
99 */ |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
100 static void uninit(sh_video_t *sh) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
101 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
102 theora_struct_t *context = (theora_struct_t *)sh->context; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
103 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
104 if (context) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
105 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
106 theora_clear (&context->st); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
107 free (context); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
108 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
109 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
110 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
111 /* |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
112 * decode frame |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
113 */ |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
114 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
115 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
116 theora_struct_t *context = (theora_struct_t *)sh->context; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
117 int errorCode = 0; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
118 ogg_packet op; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
119 yuv_buffer yuv; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
120 mp_image_t* mpi; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
121 int i; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
122 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
123 bzero (&op, sizeof (op)); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
124 op.bytes = len; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
125 op.packet = data; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
126 op.granulepos = -1; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
127 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
128 errorCode = theora_decode_packetin (&context->st, &op); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
129 if (errorCode) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
130 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
131 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Theora decode packetin failed: %i \n", |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
132 errorCode); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
133 return NULL; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
134 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
135 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
136 errorCode = theora_decode_YUVout (&context->st, &yuv); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
137 if (errorCode) |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
138 { |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
139 mp_msg(MSGT_DEMUX,MSGL_ERR,"Theora decode YUVout failed: %i \n", |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
140 errorCode); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
141 return 0; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
142 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
143 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
144 mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0, sh->disp_w, sh->disp_h); |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
145 if(!mpi) return NULL; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
146 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
147 mpi->planes[0]=yuv.y; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
148 mpi->stride[0]=yuv.y_stride; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
149 mpi->planes[1]=yuv.u; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
150 mpi->stride[1]=yuv.uv_stride; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
151 mpi->planes[2]=yuv.v; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
152 mpi->stride[2]=yuv.uv_stride; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
153 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
154 return mpi; |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
155 } |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
156 |
5730f6098f98
theora video decoder, based on patch by David Kuehling <dvdkhlng@gmx.de>
arpi
parents:
diff
changeset
|
157 #endif |