14
14
#include < sys/time.h>
15
15
#include < sys/types.h>
16
16
#include < unistd.h>
17
+
17
18
#include < map>
18
19
19
20
#include " rtc_base/logging.h"
20
- #include " vaapi_display .h"
21
+ #include " vaapi_display_drm .h"
21
22
22
23
#define NAL_REF_IDC_NONE 0
23
24
#define NAL_REF_IDC_LOW 1
@@ -702,11 +703,10 @@ void encoding2display_order(uint64_t encoding_order,
702
703
}
703
704
}
704
705
705
- std::map<int , std::string> fourcc_map = {
706
- {VA_FOURCC_NV12, " NV12" },
707
- {VA_FOURCC_I420, " I420" },
708
- {VA_FOURCC_YV12, " YV12" },
709
- {VA_FOURCC_UYVY, " UYVY" }};
706
+ std::map<int , std::string> fourcc_map = {{VA_FOURCC_NV12, " NV12" },
707
+ {VA_FOURCC_I420, " I420" },
708
+ {VA_FOURCC_YV12, " YV12" },
709
+ {VA_FOURCC_UYVY, " UYVY" }};
710
710
711
711
static std::string fourcc_to_string (int fourcc) {
712
712
auto it = fourcc_map.find (fourcc);
@@ -718,12 +718,9 @@ static std::string fourcc_to_string(int fourcc) {
718
718
}
719
719
720
720
std::map<int , std::string> rc_mode_map = {
721
- {VA_RC_NONE, " NONE" },
722
- {VA_RC_CBR, " CBR" },
723
- {VA_RC_VBR, " VBR" },
724
- {VA_RC_VCM, " VCM" },
725
- {VA_RC_CQP, " CQP" },
726
- {VA_RC_VBR_CONSTRAINED, " VBR_CONSTRAINED" }};
721
+ {VA_RC_NONE, " NONE" }, {VA_RC_CBR, " CBR" },
722
+ {VA_RC_VBR, " VBR" }, {VA_RC_VCM, " VCM" },
723
+ {VA_RC_CQP, " CQP" }, {VA_RC_VBR_CONSTRAINED, " VBR_CONSTRAINED" }};
727
724
728
725
static std::string rc_to_string (int rcmode) {
729
726
auto it = rc_mode_map.find (rcmode);
@@ -1353,11 +1350,10 @@ static int render_sequence(VA264Context* context) {
1353
1350
return 0 ;
1354
1351
}
1355
1352
1356
- std::map<int , std::string> frame_type_map = {
1357
- {FRAME_P, " P" },
1358
- {FRAME_B, " B" },
1359
- {FRAME_I, " I" },
1360
- {FRAME_IDR, " IDR" }};
1353
+ std::map<int , std::string> frame_type_map = {{FRAME_P, " P" },
1354
+ {FRAME_B, " B" },
1355
+ {FRAME_I, " I" },
1356
+ {FRAME_IDR, " IDR" }};
1361
1357
1362
1358
static std::string frametype_to_string (int ftype) {
1363
1359
auto it = frame_type_map.find (ftype);
@@ -1416,23 +1412,11 @@ static int render_picture(VA264Context* context) {
1416
1412
context->pic_param .CurrPic .TopFieldOrderCnt ;
1417
1413
context->current_curr_pic = context->pic_param .CurrPic ;
1418
1414
1419
- if (getenv (" TO_DEL" )) { /* set RefPicList into ReferenceFrames */
1420
- update_RefPicList (context); /* calc RefPicList */
1421
- memset (context->pic_param .ReferenceFrames , 0xff ,
1422
- 16 * sizeof (VAPictureH264)); /* invalid all */
1423
- if (context->current_frame_type == FRAME_P) {
1424
- context->pic_param .ReferenceFrames [0 ] = context->ref_pic_list0_p [0 ];
1425
- } else if (context->current_frame_type == FRAME_B) {
1426
- context->pic_param .ReferenceFrames [0 ] = context->ref_pic_list0_b [0 ];
1427
- context->pic_param .ReferenceFrames [1 ] = context->ref_pic_list1_b [0 ];
1428
- }
1429
- } else {
1430
- memcpy (context->pic_param .ReferenceFrames , context->reference_frames ,
1431
- context->num_short_term * sizeof (VAPictureH264));
1432
- for (i = context->num_short_term ; i < SURFACE_NUM; i++) {
1433
- context->pic_param .ReferenceFrames [i].picture_id = VA_INVALID_SURFACE;
1434
- context->pic_param .ReferenceFrames [i].flags = VA_PICTURE_H264_INVALID;
1435
- }
1415
+ memcpy (context->pic_param .ReferenceFrames , context->reference_frames ,
1416
+ context->num_short_term * sizeof (VAPictureH264));
1417
+ for (i = context->num_short_term ; i < SURFACE_NUM; i++) {
1418
+ context->pic_param .ReferenceFrames [i].picture_id = VA_INVALID_SURFACE;
1419
+ context->pic_param .ReferenceFrames [i].flags = VA_PICTURE_H264_INVALID;
1436
1420
}
1437
1421
1438
1422
context->pic_param .pic_fields .bits .idr_pic_flag =
@@ -1691,8 +1675,7 @@ VaapiH264EncoderWrapper::VaapiH264EncoderWrapper()
1691
1675
memset ((void *)context_.get (), 0 , sizeof (VA264Context));
1692
1676
}
1693
1677
1694
- VaapiH264EncoderWrapper::~VaapiH264EncoderWrapper () {
1695
- }
1678
+ VaapiH264EncoderWrapper::~VaapiH264EncoderWrapper () {}
1696
1679
1697
1680
void VaapiH264EncoderWrapper::Destroy () {
1698
1681
if (context_->va_dpy ) {
0 commit comments