Ticket #6263: hdpvr_audio_codec_selection-v1.1.diff
File hdpvr_audio_codec_selection-v1.1.diff, 3.3 KB (added by , 15 years ago) |
---|
-
libs/libmythtv/mpegrecorder.cpp
285 285 QString("%1 is invalid").arg(value)); 286 286 } 287 287 } 288 else if (opt == "audiocodec") 289 { 290 if (value == "AAC Hardware Encoder") 291 audtype = 4; 292 else if (value == "AC3 Hardware Encoder") 293 audtype = 5; 294 } 288 295 else 289 296 { 290 297 RecorderBase::SetOption(opt, value); … … 340 347 SetIntOption(profile, "medium_mpeg4peakbitrate"); 341 348 SetIntOption(profile, "high_mpeg4avgbitrate"); 342 349 SetIntOption(profile, "high_mpeg4peakbitrate"); 350 351 SetStrOption(profile, "audiocodec"); 343 352 } 344 353 345 354 // same as the base class, it just doesn't complain if an option is missing … … 829 838 { 830 839 maxbitrate = high_mpeg4peakbitrate; 831 840 bitrate = high_mpeg4avgbitrate; 841 842 // query supported audio codecs 843 struct v4l2_queryctrl qctrl; 844 qctrl.id = V4L2_CID_MPEG_AUDIO_ENCODING; 845 846 if (ioctl(chanfd, VIDIOC_QUERYCTRL, &qctrl) < 0) 847 { 848 VERBOSE(VB_IMPORTANT, LOC_WARN + 849 "Unable to get supported audio codecs." + ENO); 850 } 851 else 852 { 853 uint audio_encoding = max(min(audtype-1, qctrl.maximum), qctrl.minimum); 854 add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_AUDIO_ENCODING, 855 audio_encoding); 856 } 832 857 } 833 858 maxbitrate = std::max(maxbitrate, bitrate); 834 859 -
libs/libmythtv/recordingprofile.cpp
424 424 params->addChild(new SampleRate(parent)); 425 425 params->addChild(new BTTVVolume(parent)); 426 426 addTarget("Uncompressed", params); 427 428 params = new VerticalConfigurationGroup(false); 429 params->setLabel("AC3 Hardware Encoder"); 430 addTarget("AC3 Hardware Encoder", params); 431 432 params = new VerticalConfigurationGroup(false); 433 params->setLabel("AAC Hardware Encoder"); 434 addTarget("AAC Hardware Encoder", params); 435 427 436 }; 428 437 429 438 void selectCodecs(QString groupType) … … 432 441 { 433 442 if (groupType == "MPEG") 434 443 codecName->addSelection("MPEG-2 Hardware Encoder"); 444 else if (groupType == "HDPVR") 445 { 446 codecName->addSelection("AC3 Hardware Encoder"); 447 codecName->addSelection("AAC Hardware Encoder"); 448 } 435 449 else 436 450 { 437 451 // V4L, TRANSCODE (and any undefined types) … … 1260 1274 videoSettings = new VideoCompressionSettings(*this, profileName); 1261 1275 addChild(videoSettings); 1262 1276 1263 if (type.toUpper() != "HDPVR") 1264 { 1265 audioSettings = new AudioCompressionSettings(*this, profileName); 1266 addChild(audioSettings); 1267 } 1277 audioSettings = new AudioCompressionSettings(*this, profileName); 1278 addChild(audioSettings); 1268 1279 1269 1280 if (!profileName.isEmpty() && profileName.left(11) == "Transcoders") 1270 1281 {