annotate libmpcodecs/vd_real.c @ 6542:7af3fcd76d2d

support dropping some chroma src lines for a bit extra speed
author michael
date Mon, 24 Jun 2002 01:05:41 +0000
parents 83b3315c679b
children 70a9c9f695a2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6360
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
1 //#define USE_WIN32_REAL_CODECS
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
2
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
3 #include <stdio.h>
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
4 #include <stdlib.h>
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
5
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
6 #include "config.h"
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
7 #ifdef USE_REALCODECS
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
8
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
9 #include <dlfcn.h>
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
10
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
11 #include "mp_msg.h"
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
12 #include "help_mp.h"
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
13
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
14 #include "vd_internal.h"
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
15
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
16 static vd_info_t info = {
6404
83b3315c679b Implement Nilmoni's and Bernd Ernesti's patches for:
atmos4
parents: 6361
diff changeset
17 "RealVideo decoder",
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
18 "real",
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
19 VFM_REAL,
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
20 "Florian Schneider",
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
21 "using original closed source codecs for Linux",
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
22 "binary real video codecs"
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
23 };
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
24
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
25 LIBVD_EXTERN(real)
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
26
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
27
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
28 typedef unsigned long ulong;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
29
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
30 ulong (*rvyuv_custom_message)(ulong,ulong);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
31 ulong (*rvyuv_free)(ulong);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
32 ulong (*rvyuv_hive_message)(ulong,ulong);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
33 ulong (*rvyuv_init)(ulong,ulong);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
34 ulong (*rvyuv_transform)(ulong,ulong,ulong,ulong,ulong);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
35
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
36 void *rv_handle=NULL;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
37
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
38 void *__builtin_vec_new(unsigned long size) {
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
39 return malloc(size);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
40 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
41
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
42 void __builtin_vec_delete(void *mem) {
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
43 free(mem);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
44 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
45
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
46 void __pure_virtual(void) {
6361
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
47 printf("FATAL: __pure_virtual() called!\n");
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
48 // exit(1);
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
49 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
50
6404
83b3315c679b Implement Nilmoni's and Bernd Ernesti's patches for:
atmos4
parents: 6361
diff changeset
51 #if defined(__FreeBSD__) || defined(__NetBSD__)
6361
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
52 void ___brk_addr(void) {exit(0);}
6404
83b3315c679b Implement Nilmoni's and Bernd Ernesti's patches for:
atmos4
parents: 6361
diff changeset
53 char **__environ={NULL};
6361
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
54 #undef stderr
6404
83b3315c679b Implement Nilmoni's and Bernd Ernesti's patches for:
atmos4
parents: 6361
diff changeset
55 FILE *stderr=NULL;
6361
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
56 #endif
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
57
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
58 // to set/get/query special features/parameters
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
59 static int control(sh_video_t *sh,int cmd,void* arg,...){
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
60 // switch(cmd){
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
61 // case VDCTRL_QUERY_MAX_PP_LEVEL:
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
62 // return 9;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
63 // case VDCTRL_SET_PP_LEVEL:
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
64 // vfw_set_postproc(sh,10*(*((int*)arg)));
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
65 // return CONTROL_OK;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
66 // }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
67 return CONTROL_UNKNOWN;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
68 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
69
6360
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
70 #ifndef USE_WIN32_REAL_CODECS
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
71
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
72 /* exits program when failure */
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
73 int load_syms(char *path) {
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
74 void *handle;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
75 char *error;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
76
6361
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
77 mp_msg(MSGT_DECVIDEO,MSGL_INFO, "opening shared obj '%s'\n", path);
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
78 rv_handle = dlopen (path, RTLD_LAZY);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
79 handle=rv_handle;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
80 if (!handle) {
6361
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
81 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error: %s\n",dlerror());
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
82 return 0;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
83 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
84
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
85 rvyuv_custom_message = dlsym(handle, "RV20toYUV420CustomMessage");
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
86 rvyuv_free = dlsym(handle, "RV20toYUV420Free");
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
87 rvyuv_hive_message = dlsym(handle, "RV20toYUV420HiveMessage");
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
88 rvyuv_init = dlsym(handle, "RV20toYUV420Init");
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
89 rvyuv_transform = dlsym(handle, "RV20toYUV420Transform");
6361
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
90
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
91 if(rvyuv_custom_message &&
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
92 rvyuv_free &&
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
93 rvyuv_hive_message &&
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
94 rvyuv_init &&
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
95 rvyuv_transform) return 1;
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
96
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
97 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error resolving symbols! (version incompatibility?)\n");
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
98 return 0;
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
99 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
100
6360
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
101 #else
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
102
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
103 int load_syms(char *path) {
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
104 void *handle;
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
105 Setup_LDT_Keeper();
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
106 rv_handle = handle = LoadLibraryA(path);
6361
433bc1becbb6 freebsd support (hack) by Nexus
arpi
parents: 6360
diff changeset
107 mp_msg(MSGT_DECVIDEO,MSGL_V,"win32 real codec handle=%p \n",handle);
6360
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
108
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
109 rvyuv_custom_message = GetProcAddress(handle, "RV20toYUV420CustomMessage");
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
110 rvyuv_free = GetProcAddress(handle, "RV20toYUV420Free");
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
111 rvyuv_hive_message = GetProcAddress(handle, "RV20toYUV420HiveMessage");
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
112 rvyuv_init = GetProcAddress(handle, "RV20toYUV420Init");
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
113 rvyuv_transform = GetProcAddress(handle, "RV20toYUV420Transform");
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
114
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
115 if(rvyuv_custom_message &&
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
116 rvyuv_free &&
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
117 rvyuv_hive_message &&
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
118 rvyuv_init &&
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
119 rvyuv_transform) return 1;
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
120 return 0; // error
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
121 }
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
122
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
123 #endif
1acda8182b14 win32 dll support (non-working)
arpi
parents: 6354
diff changeset
124
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
125 /* we need exact positions */
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
126 struct rv_init_t {
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
127 short unk1;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
128 short w;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
129 short h;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
130 short unk3;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
131 int unk2;
6345
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
132 int subformat;
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
133 int unk5;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
134 int format;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
135 } rv_init_t;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
136
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
137 // init driver
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
138 static int init(sh_video_t *sh){
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
139 //unsigned int out_fmt;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
140 char path[4096];
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
141 int result;
6345
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
142 // we export codec id and sub-id from demuxer in bitmapinfohdr:
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
143 unsigned int* extrahdr=(unsigned int*)(sh->bih+1);
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
144 struct rv_init_t init_data={
6345
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
145 11, sh->disp_w, sh->disp_h,0,0,extrahdr[0],
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
146 1,extrahdr[1]}; // rv30
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
147
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
148 mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",extrahdr[1],extrahdr[0]);
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
149
6404
83b3315c679b Implement Nilmoni's and Bernd Ernesti's patches for:
atmos4
parents: 6361
diff changeset
150 sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll);
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
151 if(!load_syms(path)){
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
152 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll);
6404
83b3315c679b Implement Nilmoni's and Bernd Ernesti's patches for:
atmos4
parents: 6361
diff changeset
153 mp_msg(MSGT_DECVIDEO,MSGL_HINT,"You need to copy the contents from the RealPlayer codecs directory\n");
83b3315c679b Implement Nilmoni's and Bernd Ernesti's patches for:
atmos4
parents: 6361
diff changeset
154 mp_msg(MSGT_DECVIDEO,MSGL_HINT,"into " REALCODEC_PATH "/ !\n");
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
155 return 0;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
156 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
157 // only I420 supported
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
158 if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_I420)) return 0;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
159 // init codec:
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
160 sh->context=NULL;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
161 result=(*rvyuv_init)(&init_data, &sh->context);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
162 if (result){
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
163 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Couldn't open RealVideo codec, error code: 0x%X \n",result);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
164 return 0;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
165 }
6345
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
166 // setup rv30 codec (codec sub-type and image dimensions):
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
167 if(extrahdr[1]>=0x30000000){
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
168 ulong cmsg24[4]={sh->disp_w,sh->disp_h,sh->disp_w,sh->disp_h};
6354
66dd95953ec2 very high bitrate (RealOne) support fixed
arpi
parents: 6345
diff changeset
169 ulong cmsg_data[3]={0x24,1+((extrahdr[0]>>16)&7),&cmsg24};
6345
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
170 (*rvyuv_custom_message)(cmsg_data,sh->context);
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
171 }
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
172 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: RealVideo codec init OK!\n");
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
173 return 1;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
174 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
175
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
176 // uninit driver
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
177 static void uninit(sh_video_t *sh){
6345
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
178 if(rv_handle) dlclose(rv_handle);
2b6ff13acf5b - removed unused function pointers
arpi
parents: 6341
diff changeset
179 rv_handle=NULL;
6341
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
180 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
181
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
182 // decode a frame
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
183 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
184 mp_image_t* mpi;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
185 ulong result;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
186 int *buff=(unsigned int *)((char*)data+len);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
187 ulong transform_out[5];
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
188 ulong transform_in[6]={
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
189 len, // length of the packet (sub-packets appended)
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
190 0, // unknown, seems to be unused
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
191 buff[0], // number of sub-packets - 1
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
192 &buff[2], // table of sub-packet offsets
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
193 0, // unknown, seems to be unused
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
194 buff[1], // timestamp (the integer value from the stream)
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
195 };
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
196
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
197 if(len<=0 || flags&2) return NULL; // skipped frame || hardframedrop
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
198
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
199 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, 0 /*MP_IMGFLAG_ACCEPT_STRIDE*/,
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
200 sh->disp_w, sh->disp_h);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
201 if(!mpi) return NULL;
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
202
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
203 result=(*rvyuv_transform)(data, mpi->planes[0], transform_in,
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
204 transform_out, sh->context);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
205
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
206 return (result?NULL:mpi);
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
207 }
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
208
d79c52610702 RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff changeset
209 #endif