Imported Upstream version 0.7.6
Jaromír Mikeš
10 years ago
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 | ||
0 | 13 | 2013-06-16 (0.7.3) Robin Gareus <robin@gareus.org> |
1 | 14 | * propagate unhandled keyboard events to remote ctrl |
2 | 15 | * Add Czech translation by Pavel Fric |
250 | 250 | /* #undef TTFFONTFILE */ |
251 | 251 | |
252 | 252 | /* Version number of package */ |
253 | #define VERSION "0.7.3" | |
253 | #define VERSION "0.7.6" | |
254 | 254 | |
255 | 255 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most |
256 | 256 | significant byte first (like Motorola and SPARC, unlike Intel). */ |
2689 | 2689 | |
2690 | 2690 | VERSION_MAJOR=0 |
2691 | 2691 | VERSION_MINOR=7 |
2692 | VERSION_SUB=3 | |
2692 | VERSION_SUB=6 | |
2693 | 2693 | |
2694 | 2694 | am__api_version='1.11' |
2695 | 2695 | |
6001 | 6001 | |
6002 | 6002 | done |
6003 | 6003 | |
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 | |
6005 | 6007 | $as_echo_n "checking for library containing jack_port_get_latency_range... " >&6; } |
6006 | 6008 | if ${ac_cv_search_jack_port_get_latency_range+:} false; then : |
6007 | 6009 | $as_echo_n "(cached) " >&6 |
6058 | 6060 | NEW_JACK_LATENCY_API=1 |
6059 | 6061 | fi |
6060 | 6062 | |
6061 | fi | |
6062 | 6063 | |
6063 | 6064 | MQ_LIBS="" |
6064 | 6065 | if test "x$enable_mq" != "xno"; then |
7 | 7 | |
8 | 8 | VERSION_MAJOR=0 |
9 | 9 | VERSION_MINOR=7 |
10 | VERSION_SUB=3 | |
10 | VERSION_SUB=6 | |
11 | 11 | |
12 | 12 | dnl Every other copy of the package version number gets its value from here |
13 | 13 | AM_INIT_AUTOMAKE(xjadeo, [${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_SUB}]) |
165 | 165 | AC_SUBST(JACK_LIBS) |
166 | 166 | if test "x$enable_jacksession" != "xno"; then |
167 | 167 | 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 ) | |
170 | 171 | |
171 | 172 | MQ_LIBS="" |
172 | 173 | if test "x$enable_mq" != "xno"; then |
136 | 136 | |
137 | 137 | int main(int argc, char *argv[]) |
138 | 138 | { |
139 | AVFormatContext *ic; | |
139 | AVFormatContext *ic = NULL; | |
140 | 140 | AVCodec *p; |
141 | AVInputFormat *file_iformat = NULL; | |
142 | 141 | int err, ret, i, flags; |
143 | 142 | char str[80]; |
144 | 143 | char *fn = NULL; |
155 | 154 | av_log_set_level(AV_LOG_QUIET); |
156 | 155 | |
157 | 156 | #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); | |
161 | 160 | #endif |
162 | 161 | if (err < 0) { |
163 | 162 | fprintf(stderr, "%s: Error while opening file\n", fn); |
1199 | 1199 | text[LOGLEN -1] =0; // just to be safe :) |
1200 | 1200 | snprintf(msg, LOGLEN, "@%i %s\n",rv,text); |
1201 | 1201 | msg[LOGLEN -1] =0; |
1202 | write(REMOTE_TX,msg,strlen(msg)); | |
1202 | (void) write(REMOTE_TX,msg,strlen(msg)); | |
1203 | 1203 | } |
1204 | 1204 | |
1205 | 1205 | void open_remote_ctrl (void) { |
1372 | 1372 | if (remote_en) { |
1373 | 1373 | snprintf(msg, LOGLEN, "@%i %s\n",rv,text); |
1374 | 1374 | msg[LOGLEN -1] =0; |
1375 | write(REMOTE_TX,msg,strlen(msg)); | |
1375 | (void) write(REMOTE_TX,msg,strlen(msg)); | |
1376 | 1376 | } |
1377 | 1377 | } |
1378 | 1378 |
311 | 311 | |
312 | 312 | // Assign appropriate parts of buffer to image planes in pFrameFMT |
313 | 313 | 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); | |
315 | 315 | #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); | |
317 | 317 | #endif |
318 | 318 | } |
319 | 319 | render_empty_frame(0); |
457 | 457 | fprintf(stdout, "original frame rate: %g\n", framerate); |
458 | 458 | fprintf(stdout, "length in seconds: %g\n", duration); |
459 | 459 | 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); | |
461 | 461 | } |
462 | 462 | |
463 | 463 | // Get a pointer to the codec context for the video stream |
467 | 467 | pCodecCtx=&(pFormatCtx->streams[videoStream]->codec); |
468 | 468 | #endif |
469 | 469 | |
470 | if (!want_quiet) { | |
471 | fprintf(stderr, "image size: %ix%i px\n", pCodecCtx->width, pCodecCtx->height); | |
472 | } | |
473 | ||
470 | 474 | #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; | |
490 | 492 | |
491 | 493 | 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) { | |
494 | 496 | ffctv_width = movie_width; |
495 | ffctv_height = ((int)rint(movie_width / movie_aspect)) & ~1; | |
497 | ffctv_height = ((int)rint(pCodecCtx->width / movie_aspect)) & ~1; | |
496 | 498 | } |
497 | 499 | |
498 | 500 | // somewhere around LIBAVFORMAT_BUILD 4630 |
503 | 505 | #endif |
504 | 506 | |
505 | 507 | 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); | |
507 | 509 | } |
508 | 510 | // Find the decoder for the video stream |
509 | 511 | pCodec=avcodec_find_decoder(pCodecCtx->codec_id); |
849 | 851 | if(frameFinished) { |
850 | 852 | /* Convert the image from its native format to FMT */ |
851 | 853 | #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); | |
853 | 873 | #else |
854 | 874 | img_convert((AVPicture *)pFrameFMT, render_fmt, |
855 | 875 | (AVPicture*)pFrame, pCodecCtx->pix_fmt, pCodecCtx->width, |
27 | 27 | #include <avutil.h> |
28 | 28 | #else |
29 | 29 | #include <libavutil/avutil.h> |
30 | #include <libavutil/mathematics.h> | |
30 | 31 | #endif |
31 | 32 | |
32 | 33 | #ifndef PIX_FMT_BGRA32 |
360 | 360 | #if 1 |
361 | 361 | char tmp[8+MQLEN]; |
362 | 362 | 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)); | |
364 | 364 | #else |
365 | 365 | printf ("@%d %s", mymsg->cmd, mymsg->m); // newline is part of data payload. |
366 | 366 | fflush(stdout); |