File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -464,8 +464,27 @@ int h264_get_controls(struct request_data *driver_data,
464
464
return VA_STATUS_SUCCESS ;
465
465
}
466
466
467
+ static inline __u8 h264_profile_to_idc (VAProfile profile )
468
+ {
469
+ switch (profile ) {
470
+ case VAProfileH264Main :
471
+ return 77 ;
472
+ case VAProfileH264High :
473
+ return 100 ;
474
+ case VAProfileH264ConstrainedBaseline :
475
+ return 66 ;
476
+ case VAProfileH264MultiviewHigh :
477
+ return 118 ;
478
+ case VAProfileH264StereoHigh :
479
+ return 128 ;
480
+ default :
481
+ return 0 ;
482
+ }
483
+ }
484
+
467
485
int h264_set_controls (struct request_data * driver_data ,
468
486
struct object_context * context ,
487
+ VAProfile profile ,
469
488
struct object_surface * surface )
470
489
{
471
490
struct v4l2_ctrl_h264_scaling_matrix matrix = { 0 };
@@ -494,6 +513,8 @@ int h264_set_controls(struct request_data *driver_data,
494
513
& surface -> params .h264 .slice ,
495
514
& surface -> params .h264 .picture , & slice );
496
515
516
+ sps .profile_idc = h264_profile_to_idc (profile );
517
+
497
518
struct v4l2_ext_control controls [5 ] = {
498
519
{
499
520
.id = V4L2_CID_MPEG_VIDEO_H264_SPS ,
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ int h264_get_controls(struct request_data *driver_data,
55
55
struct object_context * context );
56
56
int h264_set_controls (struct request_data * data ,
57
57
struct object_context * context ,
58
+ VAProfile profile ,
58
59
struct object_surface * surface );
59
60
60
61
#endif
Original file line number Diff line number Diff line change @@ -193,7 +193,8 @@ static VAStatus codec_set_controls(struct request_data *driver_data,
193
193
case VAProfileH264ConstrainedBaseline :
194
194
case VAProfileH264MultiviewHigh :
195
195
case VAProfileH264StereoHigh :
196
- rc = h264_set_controls (driver_data , context , surface_object );
196
+ rc = h264_set_controls (driver_data , context , profile ,
197
+ surface_object );
197
198
if (rc < 0 )
198
199
return VA_STATUS_ERROR_OPERATION_FAILED ;
199
200
break ;
You can’t perform that action at this time.
0 commit comments