Ticket #2171: 2171-nvr.patch
File 2171-nvr.patch, 6.4 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/NuppelVideoRecorder.cpp
2752 2752 case ACTION_VIDEO: 2753 2753 { 2754 2754 VideoFrame frame; 2755 frame.codec = FMT_YV12; 2756 frame.width = w; 2757 frame.height = h; 2758 frame.buf = videobuffer[act_video_encode]->buffer; 2759 frame.size = videobuffer[act_video_encode]->bufferlen; 2755 init(&frame, 2756 FMT_YV12, videobuffer[act_video_encode]->buffer, 2757 w, h, 12, videobuffer[act_video_encode]->bufferlen); 2758 2760 2759 frame.frameNumber = videobuffer[act_video_encode]->sample; 2761 2760 frame.timecode = videobuffer[act_video_encode]->timecode; 2762 2761 frame.forcekey = videobuffer[act_video_encode]->forcekey; -
libs/libmythtv/frame.h
1 1 #ifndef _FRAME_H 2 2 #define _FRAME_H 3 3 4 #include <string.h> 5 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 4 10 typedef enum FrameType_ 5 11 { 6 12 FMT_NONE = -1, … … 20 26 VideoFrameType codec; 21 27 unsigned char *buf; 22 28 29 int width; 23 30 int height; 24 int width;25 31 int bpp; 26 32 int size; 27 33 … … 42 48 int offsets[3]; // Y, U, & V offsets 43 49 } VideoFrame; 44 50 51 #ifdef __cplusplus 52 } 45 53 #endif 46 54 55 #ifdef __cplusplus 56 static inline void init( 57 VideoFrame *vf, 58 VideoFrameType _codec, unsigned char *_buf, 59 int _width, int _height, int _bpp, int _size, 60 const int *p = 0, const int *o = 0) __attribute__ ((unused)); 61 62 static inline void init( 63 VideoFrame *vf, 64 VideoFrameType _codec, unsigned char *_buf, 65 int _width, int _height, int _bpp, int _size, 66 const int *p, const int *o) 67 { 68 vf->codec = _codec; 69 vf->buf = _buf; 70 vf->width = _width; 71 vf->height = _height; 72 73 vf->bpp = _bpp; 74 vf->size = _size; 75 vf->frameNumber = 0; 76 vf->timecode = 0; 77 78 vf->qscale_table = 0; 79 vf->qstride = 0; 80 81 vf->interlaced_frame = 1; 82 vf->top_field_first = 1; 83 vf->repeat_pict = 0; 84 vf->forcekey = 0; 85 86 bzero(vf->priv, 4 * sizeof(unsigned char *)); 87 88 if (p) 89 { 90 memcpy(vf->pitches, p, 3 * sizeof(int)); 91 } 92 else 93 { 94 if (FMT_YV12 == _codec || FMT_YUV422P == _codec) 95 { 96 vf->pitches[0] = _width; 97 vf->pitches[1] = vf->pitches[2] = _width >> 1; 98 } 99 else 100 { 101 vf->pitches[0] = (_width * _bpp) >> 3; 102 vf->pitches[1] = vf->pitches[2] = 0; 103 } 104 } 105 106 if (o) 107 { 108 memcpy(vf->offsets, o, 3 * sizeof(int)); 109 } 110 else 111 { 112 if (FMT_YV12 == _codec) 113 { 114 vf->offsets[0] = 0; 115 vf->offsets[1] = _width * _height; 116 vf->offsets[2] = vf->offsets[1] + (vf->offsets[1] >> 2); 117 } 118 else if (FMT_YUV422P == _codec) 119 { 120 vf->offsets[0] = 0; 121 vf->offsets[1] = _width * _height; 122 vf->offsets[2] = vf->offsets[1] + (vf->offsets[1] >> 1); 123 } 124 else 125 { 126 vf->offsets[0] = vf->offsets[1] = vf->offsets[2] = 0; 127 } 128 } 129 } 130 131 #endif /* __cplusplus */ 132 133 #endif 134 -
libs/libmythtv/videoout_ivtv.cpp
443 443 return; 444 444 445 445 VideoFrame tmpframe; 446 tmpframe.codec = FMT_ARGB32; 447 tmpframe.buf = (unsigned char *)osdbuf_aligned; 448 tmpframe.width = stride; 449 tmpframe.height = video_dim.height(); 446 init(&tmpframe, FMT_ARGB32, (unsigned char *)osdbuf_aligned, 447 stride, video_dim.height(), 32, 4 * stride * video_dim.height()); 450 448 451 449 OSDSurface *surface = NULL; 452 450 if (osd) -
libs/libmythtv/videobuffers.cpp
1135 1135 1136 1136 for (uint i = 0; i < allocSize(); i++) 1137 1137 { 1138 buffers[i].width = yuvinfo[i].width; 1139 buffers[i].height = yuvinfo[i].height; 1140 memcpy(buffers[i].pitches, yuvinfo[i].pitches, 3 * sizeof(int)); 1141 memcpy(buffers[i].offsets, yuvinfo[i].offsets, 3 * sizeof(int)); 1142 buffers[i].bpp = 12; 1143 buffers[i].size = max(buf_size, yuvinfo[i].size); 1144 buffers[i].codec = FMT_YV12; 1145 buffers[i].qscale_table = NULL; 1146 buffers[i].qstride = 0; 1147 buffers[i].buf = bufs[i]; 1138 init(&buffers[i], 1139 FMT_YV12, bufs[i], yuvinfo[i].width, yuvinfo[i].height, 1140 12, max(buf_size, yuvinfo[i].size), 1141 (const int*) yuvinfo[i].pitches, (const int*) yuvinfo[i].offsets); 1142 1148 1143 ok &= (bufs[i] != NULL); 1149 1144 } 1150 1145 … … 1187 1182 xvmc_render_state_t *render = new xvmc_render_state_t; 1188 1183 allocated_structs.push_back((unsigned char*)render); 1189 1184 memset(render, 0, sizeof(xvmc_render_state_t)); 1190 buffers[i].buf = (unsigned char*) render;1191 1185 1192 1186 // constants 1193 1187 render->magic = MP_XVMC_RENDER_MAGIC; 1194 1188 render->state = 0; 1195 buffers[i].bpp = -1;1196 buffers[i].codec = FMT_XVMC_IDCT_MPEG2;1197 buffers[i].size = sizeof(XvMCSurface);1198 1189 1199 1190 // from videoout_xv 1200 1191 render->disp = disp; 1201 1192 render->ctx = &xvmc_ctx; 1202 1193 1203 // from width, height, andxvmv block and surface arrays1194 // from xvmv block and surface arrays 1204 1195 render->p_surface = &surf->surface; 1205 buffers[i].height = height;1206 buffers[i].width = width;1207 1196 1208 1197 render->total_number_of_data_blocks = surf->blocks.num_blocks; 1209 1198 render->total_number_of_mv_blocks = surf->macro_blocks.num_blocks; 1199 1200 init(&buffers[i], 1201 FMT_XVMC_IDCT_MPEG2, (unsigned char*) render, 1202 width, height, -1, sizeof(XvMCSurface)); 1203 1210 1204 buffers[i].priv[0] = ffmpeg_vld_hack; 1211 1205 buffers[i].priv[1] = ffmpeg_vld_hack; 1212 1206