51
51
#include "autoconfig.h"
52
52
53
53
static VAStatus codec_store_buffer (struct request_data * driver_data ,
54
+ struct object_context * context ,
54
55
VAProfile profile ,
55
56
struct object_surface * surface_object ,
56
57
struct object_buffer * buffer_object )
@@ -63,6 +64,14 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
63
64
* RenderPicture), we can't use a V4L2 buffer directly
64
65
* and have to copy from a regular buffer.
65
66
*/
67
+ if (context -> h264_start_code ) {
68
+ static const char start_code [3 ] = { 0x00 , 0x00 , 0x01 };
69
+
70
+ memcpy (surface_object -> source_data +
71
+ surface_object -> slices_size ,
72
+ start_code , sizeof (start_code ));
73
+ surface_object -> slices_size += sizeof (start_code );
74
+ }
66
75
memcpy (surface_object -> source_data +
67
76
surface_object -> slices_size ,
68
77
buffer_object -> data ,
@@ -255,7 +264,8 @@ VAStatus RequestRenderPicture(VADriverContextP context, VAContextID context_id,
255
264
if (buffer_object == NULL )
256
265
return VA_STATUS_ERROR_INVALID_BUFFER ;
257
266
258
- rc = codec_store_buffer (driver_data , config_object -> profile ,
267
+ rc = codec_store_buffer (driver_data , context_object ,
268
+ config_object -> profile ,
259
269
surface_object , buffer_object );
260
270
if (rc != VA_STATUS_SUCCESS )
261
271
return rc ;
0 commit comments