Codebase list xjadeo / 3cbd722
Imported Upstream version 0.7.6 Jaromír Mikeš 10 years ago
9 changed file(s) with 77 addition(s) and 42 deletion(s). Raw diff Collapse all Expand all
0 2013-08-08 (0.7.6) Robin Gareus <robin@gareus.org>
1 * fix DAR, SAR aspect ratio and odd-number of lines
2 * detect jack-latency API independently from jack-sessio
3 * fix some compiler warnings & work-around undocumented libav API change
4
5 2013-07-25 (0.7.5) Robin Gareus <robin@gareus.org>
6 * fix UYVY422 colorspace (OSX default) stride
7 * xjinfo - fix segfault if invalid file-name is given
8
9 2013-06-27 (0.7.4) Robin Gareus <robin@gareus.org>
10 * fix for XVideo, YUV - force even number of pixels per line
11 * OSX build w/header-pad for dynamic libs.
12
013 2013-06-16 (0.7.3) Robin Gareus <robin@gareus.org>
114 * propagate unhandled keyboard events to remote ctrl
215 * Add Czech translation by Pavel Fric
250250 /* #undef TTFFONTFILE */
251251
252252 /* Version number of package */
253 #define VERSION "0.7.3"
253 #define VERSION "0.7.6"
254254
255255 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
256256 significant byte first (like Motorola and SPARC, unlike Intel). */
26892689
26902690 VERSION_MAJOR=0
26912691 VERSION_MINOR=7
2692 VERSION_SUB=3
2692 VERSION_SUB=6
26932693
26942694 am__api_version='1.11'
26952695
60016001
60026002 done
60036003
6004 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing jack_port_get_latency_range" >&5
6004 fi
6005
6006 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing jack_port_get_latency_range" >&5
60056007 $as_echo_n "checking for library containing jack_port_get_latency_range... " >&6; }
60066008 if ${ac_cv_search_jack_port_get_latency_range+:} false; then :
60076009 $as_echo_n "(cached) " >&6
60586060 NEW_JACK_LATENCY_API=1
60596061 fi
60606062
6061 fi
60626063
60636064 MQ_LIBS=""
60646065 if test "x$enable_mq" != "xno"; then
77
88 VERSION_MAJOR=0
99 VERSION_MINOR=7
10 VERSION_SUB=3
10 VERSION_SUB=6
1111
1212 dnl Every other copy of the package version number gets its value from here
1313 AM_INIT_AUTOMAKE(xjadeo, [${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_SUB}])
165165 AC_SUBST(JACK_LIBS)
166166 if test "x$enable_jacksession" != "xno"; then
167167 AC_CHECK_HEADERS([jack/session.h] , AC_DEFINE(JACK_SESSION) JACK_SESSION=1)
168 AC_SEARCH_LIBS(jack_port_get_latency_range, jack, AC_DEFINE(NEW_JACK_LATENCY_API) NEW_JACK_LATENCY_API=1 )
169 fi
168 fi
169
170 AC_SEARCH_LIBS(jack_port_get_latency_range, jack, AC_DEFINE(NEW_JACK_LATENCY_API) NEW_JACK_LATENCY_API=1 )
170171
171172 MQ_LIBS=""
172173 if test "x$enable_mq" != "xno"; then
136136
137137 int main(int argc, char *argv[])
138138 {
139 AVFormatContext *ic;
139 AVFormatContext *ic = NULL;
140140 AVCodec *p;
141 AVInputFormat *file_iformat = NULL;
142141 int err, ret, i, flags;
143142 char str[80];
144143 char *fn = NULL;
155154 av_log_set_level(AV_LOG_QUIET);
156155
157156 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 7, 0)
158 err = av_open_input_file(&ic, fn, file_iformat, 0, NULL);
159 #else
160 err = avformat_open_input(&ic, fn, file_iformat, NULL);
157 err = av_open_input_file(&ic, fn, NULL, 0, NULL);
158 #else
159 err = avformat_open_input(&ic, fn, NULL, NULL);
161160 #endif
162161 if (err < 0) {
163162 fprintf(stderr, "%s: Error while opening file\n", fn);
11991199 text[LOGLEN -1] =0; // just to be safe :)
12001200 snprintf(msg, LOGLEN, "@%i %s\n",rv,text);
12011201 msg[LOGLEN -1] =0;
1202 write(REMOTE_TX,msg,strlen(msg));
1202 (void) write(REMOTE_TX,msg,strlen(msg));
12031203 }
12041204
12051205 void open_remote_ctrl (void) {
13721372 if (remote_en) {
13731373 snprintf(msg, LOGLEN, "@%i %s\n",rv,text);
13741374 msg[LOGLEN -1] =0;
1375 write(REMOTE_TX,msg,strlen(msg));
1375 (void) write(REMOTE_TX,msg,strlen(msg));
13761376 }
13771377 }
13781378
311311
312312 // Assign appropriate parts of buffer to image planes in pFrameFMT
313313 if (pFrameFMT) {
314 avpicture_fill((AVPicture *)pFrameFMT, buffer, render_fmt, pCodecCtx->width, pCodecCtx->height);
314 avpicture_fill((AVPicture *)pFrameFMT, buffer, render_fmt, movie_width, movie_height);
315315 #ifdef HAVE_SWSCALE
316 pSWSCtx = sws_getContext(pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height, render_fmt, SWS_BICUBIC, NULL, NULL, NULL);
316 pSWSCtx = sws_getContext(pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt, movie_width, movie_height, render_fmt, SWS_BICUBIC, NULL, NULL, NULL);
317317 #endif
318318 }
319319 render_empty_frame(0);
457457 fprintf(stdout, "original frame rate: %g\n", framerate);
458458 fprintf(stdout, "length in seconds: %g\n", duration);
459459 fprintf(stdout, "total frames: %ld\n", frames);
460 fprintf(stdout, "file start offset: %lld video-frames\n",file_frame_offset);
460 fprintf(stdout, "file start offset: %" PRId64 " video-frames\n",file_frame_offset);
461461 }
462462
463463 // Get a pointer to the codec context for the video stream
467467 pCodecCtx=&(pFormatCtx->streams[videoStream]->codec);
468468 #endif
469469
470 if (!want_quiet) {
471 fprintf(stderr, "image size: %ix%i px\n", pCodecCtx->width, pCodecCtx->height);
472 }
473
470474 #ifdef CROPIMG
471 movie_width = pCodecCtx->width / 2; // TODO allow configuration
472 movie_height = pCodecCtx->height;
473 #else
474 movie_width = pCodecCtx->width;
475 movie_height = pCodecCtx->height;
476 #endif
477
478 movie_aspect = 0;
479 if (movie_aspect<=0.0) {
480 if (av_stream->sample_aspect_ratio.num)
481 movie_aspect = av_q2d(av_stream->sample_aspect_ratio);
482 else if (av_stream->codec->sample_aspect_ratio.num)
483 movie_aspect = av_q2d(av_stream->codec->sample_aspect_ratio);
484 else
485 movie_aspect = 0;
486 }
487 if (movie_aspect <= 0.0)
488 movie_aspect = 1.0;
489 movie_aspect *= (float)movie_width / (float)movie_height;
475 movie_width = (pCodecCtx->width / 2)&~1; // TODO allow configuration
476 movie_height = pCodecCtx->height &~1;
477 #else
478 movie_width = pCodecCtx->width &~1;
479 movie_height = pCodecCtx->height &~1;
480 #endif
481
482 float sample_aspect = 1.0;
483
484 if (av_stream->sample_aspect_ratio.num)
485 sample_aspect = av_q2d(av_stream->sample_aspect_ratio);
486 else if (av_stream->codec->sample_aspect_ratio.num)
487 sample_aspect = av_q2d(av_stream->codec->sample_aspect_ratio);
488 else
489 sample_aspect = 1.0;
490
491 movie_aspect = sample_aspect * (float)pCodecCtx->width / (float) pCodecCtx->height;
490492
491493 ffctv_height = movie_height;
492 ffctv_width = ((int)rint(movie_height * movie_aspect)) & ~1;
493 if (ffctv_width > movie_width) {
494 ffctv_width = ((int)rint(pCodecCtx->height * movie_aspect)) & ~1;
495 if (ffctv_width > pCodecCtx->width) {
494496 ffctv_width = movie_width;
495 ffctv_height = ((int)rint(movie_width / movie_aspect)) & ~1;
497 ffctv_height = ((int)rint(pCodecCtx->width / movie_aspect)) & ~1;
496498 }
497499
498500 // somewhere around LIBAVFORMAT_BUILD 4630
503505 #endif
504506
505507 if (!want_quiet) {
506 fprintf( stderr, "movie size: %ix%i px\n", movie_width,movie_height);
508 fprintf(stderr, "display size: %ix%i px\n", movie_width, movie_height);
507509 }
508510 // Find the decoder for the video stream
509511 pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
849851 if(frameFinished) {
850852 /* Convert the image from its native format to FMT */
851853 #ifdef HAVE_SWSCALE
852 sws_scale(pSWSCtx, (const uint8_t * const*)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameFMT->data, pFrameFMT->linesize);
854 int dstStride[8] = {0,0,0,0,0,0,0,0};
855 switch (render_fmt) {
856 case PIX_FMT_RGBA32:
857 case PIX_FMT_BGRA32:
858 dstStride[0] = movie_width*4;
859 break;
860 case PIX_FMT_BGR24:
861 dstStride[0] = movie_width*3;
862 break;
863 case PIX_FMT_UYVY422:
864 dstStride[0] = movie_width*2;
865 break;
866 case PIX_FMT_YUV420P:
867 default:
868 dstStride[0] = movie_width;
869 dstStride[1] = movie_width/2;
870 dstStride[2] = movie_width/2;
871 }
872 sws_scale(pSWSCtx, (const uint8_t * const*)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameFMT->data, dstStride);
853873 #else
854874 img_convert((AVPicture *)pFrameFMT, render_fmt,
855875 (AVPicture*)pFrame, pCodecCtx->pix_fmt, pCodecCtx->width,
2727 #include <avutil.h>
2828 #else
2929 #include <libavutil/avutil.h>
30 #include <libavutil/mathematics.h>
3031 #endif
3132
3233 #ifndef PIX_FMT_BGRA32
360360 #if 1
361361 char tmp[8+MQLEN];
362362 snprintf (tmp,(MQLEN+8),"@%d %s", mymsg->cmd, mymsg->m); // newline is part of data payload.
363 write(REMOTE_TX,tmp,strlen(tmp));
363 (void) write(REMOTE_TX,tmp,strlen(tmp));
364364 #else
365365 printf ("@%d %s", mymsg->cmd, mymsg->m); // newline is part of data payload.
366366 fflush(stdout);