diff -urN mythtv-cvs/configure mythtv/configure
old
|
new
|
|
187 | 187 | amr_wb="no" |
188 | 188 | amr_nb_fixed="no" |
189 | 189 | sunmlib="no" |
190 | | pthreads="no" |
| 190 | pthreads="yes" |
191 | 191 | gpl="yes" |
192 | 192 | memalignhack="no" |
193 | 193 | |
… |
… |
|
1251 | 1251 | extralibs="$extralibs -lpthread" |
1252 | 1252 | fi |
1253 | 1253 | fi |
| 1254 | if test "$pthreads" = "yes" ; then |
| 1255 | echo "HAVE_PTHREADS=yes" >> config.mak |
| 1256 | echo "#define HAVE_PTHREADS 1" >> $TMPH |
| 1257 | if test $targetos != FreeBSD; then |
| 1258 | extralibs="$extralibs -lpthread" |
| 1259 | fi |
| 1260 | fi |
1254 | 1261 | if test "$sdl" = "yes" ; then |
1255 | 1262 | echo "CONFIG_SDL=yes" >> config.mak |
1256 | 1263 | echo "SDL_LIBS=`sdl-config --libs`" >> config.mak |
diff -urN mythtv-cvs/libs/libavcodec/libavcodec.pro mythtv/libs/libavcodec/libavcodec.pro
old
|
new
|
|
44 | 44 | |
45 | 45 | LIBS += $$LOCAL_LIBDIR_X11 |
46 | 46 | |
| 47 | contains( HAVE_PTHREADS, yes) { |
| 48 | SOURCES += pthread.c |
| 49 | } |
| 50 | |
47 | 51 | contains( CONFIG_AC3, yes ) { |
48 | 52 | SOURCES += a52dec.c |
49 | 53 | !contains( CONFIG_A52BIN, yes ) { |
diff -urN mythtv-cvs/libs/libmythtv/NuppelVideoRecorder.cpp mythtv/libs/libmythtv/NuppelVideoRecorder.cpp
old
|
new
|
|
130 | 130 | qualdiff = 3; |
131 | 131 | mp4opts = 0; |
132 | 132 | mb_decision = FF_MB_DECISION_SIMPLE; |
| 133 | thread_count = 1; |
133 | 134 | |
134 | 135 | oldtc = 0; |
135 | 136 | startnum = 0; |
… |
… |
|
238 | 239 | minquality = value; |
239 | 240 | else if (opt == "mpeg4qualdiff") |
240 | 241 | qualdiff = value; |
| 242 | else if (opt == "mpeg4threadcount") |
| 243 | thread_count = value; |
241 | 244 | else if (opt == "mpeg4optionvhq") |
242 | 245 | { |
243 | 246 | if (value) |
… |
… |
|
314 | 317 | SetIntOption(profile, "mpeg4maxquality"); |
315 | 318 | SetIntOption(profile, "mpeg4minquality"); |
316 | 319 | SetIntOption(profile, "mpeg4qualdiff"); |
| 320 | SetIntOption(profile, "mpeg4threadcount"); |
317 | 321 | SetIntOption(profile, "mpeg4optionvhq"); |
318 | 322 | SetIntOption(profile, "mpeg4option4mv"); |
319 | 323 | } |
… |
… |
|
512 | 516 | if (codec.lower() == "huffyuv" || codec.lower() == "mjpeg") |
513 | 517 | mpa_ctx->strict_std_compliance = -1; |
514 | 518 | |
| 519 | if(thread_count > 1) |
| 520 | if(avcodec_thread_init(mpa_ctx, thread_count)) |
| 521 | VERBOSE(VB_IMPORTANT, QString("AVCodec thread init failed")); |
| 522 | |
515 | 523 | pthread_mutex_lock(&avcodeclock); |
516 | 524 | if (avcodec_open(mpa_ctx, mpa_codec) < 0) |
517 | 525 | { |
… |
… |
|
1584 | 1592 | pthread_join(audio_tid, NULL); |
1585 | 1593 | if (vbimode) |
1586 | 1594 | pthread_join(vbi_tid, NULL); |
| 1595 | |
| 1596 | if(useavcodec && thread_count > 1) |
| 1597 | avcodec_thread_free(mpa_ctx); |
1587 | 1598 | } |
1588 | 1599 | |
1589 | 1600 | void NuppelVideoRecorder::BufferIt(unsigned char *buf, int len) |
diff -urN mythtv-cvs/libs/libmythtv/NuppelVideoRecorder.h mythtv/libs/libmythtv/NuppelVideoRecorder.h
old
|
new
|
|
245 | 245 | int qualdiff; |
246 | 246 | int mp4opts; |
247 | 247 | int mb_decision; |
| 248 | int thread_count; |
248 | 249 | |
249 | 250 | QString videoFilterList; |
250 | 251 | FilterChain *videoFilters; |
diff -urN mythtv-cvs/libs/libmythtv/recordingprofile.cpp mythtv/libs/libmythtv/recordingprofile.cpp
old
|
new
|
|
411 | 411 | }; |
412 | 412 | }; |
413 | 413 | |
| 414 | class MPEG4ThreadCount: public CodecParam, public SliderSetting { |
| 415 | public: |
| 416 | MPEG4ThreadCount(const RecordingProfile& parent): |
| 417 | CodecParam(parent, "mpeg4threadcount"), |
| 418 | SliderSetting(1,8,1) { |
| 419 | |
| 420 | setLabel(QObject::tr("Threads")); |
| 421 | setValue(1); |
| 422 | setHelpText(QObject::tr("Threads to use for encoding, set greater " |
| 423 | "than 1 for faster encoding with SMP or " |
| 424 | "HyperThreading.")); |
| 425 | }; |
| 426 | }; |
| 427 | |
414 | 428 | class MPEG2bitrate: public CodecParam, public SliderSetting { |
415 | 429 | public: |
416 | 430 | MPEG2bitrate(const RecordingProfile& parent): |
… |
… |
|
541 | 555 | params->addChild(new MPEG4MaxQuality(parent)); |
542 | 556 | params->addChild(new MPEG4MinQuality(parent)); |
543 | 557 | params->addChild(new MPEG4QualDiff(parent)); |
| 558 | params->addChild(new MPEG4ThreadCount(parent)); |
544 | 559 | params->addChild(new MPEG4ScaleBitrate(parent)); |
545 | 560 | |
546 | 561 | HorizontalConfigurationGroup *hq; |