if( hw_pix_fmt >= 0 ) {
hw_pixfmt = hw_pix_fmt;
avctx->get_format = get_hw_format;
+ const char *drm_node = getenv("CIN_DRM_DEC");
+ if(drm_node && type==AV_HWDEVICE_TYPE_VAAPI) {
+ ret = av_hwdevice_ctx_create(&hw_device_ctx, type, drm_node, 0, 0);
+ }
+ else {
ret = av_hwdevice_ctx_create(&hw_device_ctx, type, 0, 0, 0);
+ }
+
if( ret >= 0 ) {
avctx->hw_device_ctx = av_buffer_ref(hw_device_ctx);
ret = 1;
AVHWDeviceType FFVideoStream::encode_hw_activate(const char *hw_dev)
{
+ const char *drm_node_enc = getenv("CIN_DRM_ENC");
AVBufferRef *hw_device_ctx = 0;
AVBufferRef *hw_frames_ref = 0;
AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE;
}
}
if( type != AV_HWDEVICE_TYPE_NONE ) {
- int ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, 0, 0, 0);
+ int ret = 0;
+ if (drm_node_enc) {
+ ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, drm_node_enc, 0, 0);
+ } else {
+ ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, 0, 0, 0);
+ }
if( ret < 0 ) {
ff_err(ret, "Failed to create a HW device.\n");
type = AV_HWDEVICE_TYPE_NONE;
vid->width = asset->width;
vid->height = asset->height;
vid->frame_rate = asset->frame_rate;
+#if 0
+ char tc_str[20] = "00:00:00:00";
+ double tc_offset;
+ if(asset->timecode > 0)
+ Units::totext(tc_str, asset->timecode, TIME_HMSF, 0, asset->frame_rate, 0);
+ //printf("tc: %s \n", tc_str);
+ av_dict_set(&st->metadata, "timecode", tc_str, 0);
+#endif
if( (vid->color_range = asset->ff_color_range) < 0 )
vid->color_range = file_base->file->preferences->yuv_color_range;
switch( vid->color_range ) {