[FFmpeg-soc] [soc]: r5791 - mms/mmst.c

2010-05-11 Thread spyfeng
Author: spyfeng
Date: Tue May 11 18:02:29 2010
New Revision: 5791

Log:
modify the condition to check unexpected packet type,
because some situation doesn't mean wrong workflow.
In a word, make it more robust.

Modified:
   mms/mmst.c

Modified: mms/mmst.c
==
--- mms/mmst.c  Tue May 11 17:02:06 2010(r5790)
+++ mms/mmst.c  Tue May 11 18:02:29 2010(r5791)
@@ -340,15 +340,6 @@ static MMSSCPacketType get_tcp_server_re
 return packet_type;
 }
 }
-
-if (packet_type == SC_PKT_KEEPALIVE) {
-send_keepalive_packet(mms);
-} else if (packet_type == SC_PKT_STREAM_CHANGING) {
-handle_packet_stream_changing_type(mms);
-//TODO: Handle new header when change the stream type.
-} else if (packet_type == SC_PKT_ASF_MEDIA) {
-pad_media_packet(mms);
-}
 return packet_type;
 }
 
@@ -364,11 +355,26 @@ static int mms_safe_send_recv(MMSContext
 return ret;
 }
 }
-if((type = get_tcp_server_response(mms)) != expect_type) {
-dprintf(NULL,Unhandled packet type %d\n, type);
-return -1;
+
+recv_again:
+type = get_tcp_server_response(mms);
+if (type != expect_type) {
+if (type == SC_PKT_KEEPALIVE) {
+send_keepalive_packet(mms);
+goto recv_again;
+} else if (type == SC_PKT_STREAM_CHANGING) {
+handle_packet_stream_changing_type(mms);
+//TODO: Handle new header when change the stream type.
+return -1;
+} else {
+dprintf(NULL,Unhandled packet type %d\n, type);
+return -1;
+}
+} else {
+if (type == SC_PKT_ASF_MEDIA)
+pad_media_packet(mms);
+return 0;
 }
-return 0;
 }
 
 static int send_media_header_request(MMSContext *mms)
___
FFmpeg-soc mailing list
FFmpeg-soc@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc


[FFmpeg-soc] [soc]: r5793 - libavfilter/diffs/03_libavfilter_doc.diff

2010-05-11 Thread bcoudurier
Author: bcoudurier
Date: Wed May 12 00:00:00 2010
New Revision: 5793

Log:
rename overlay filter variables

Modified:
   libavfilter/diffs/03_libavfilter_doc.diff

Modified: libavfilter/diffs/03_libavfilter_doc.diff
==
--- libavfilter/diffs/03_libavfilter_doc.diff   Tue May 11 20:41:12 2010
(r5792)
+++ libavfilter/diffs/03_libavfilter_doc.diff   Wed May 12 00:00:00 2010
(r5793)
@@ -73,11 +73,11 @@ Index: doc/libavfilter.texi
 +Parameters to the filter are separated by a colon. The first parameter
 +is the x coordinate of the overlay, the second parameter is the y
 +coordinate. The parameters need not be constant expressions, but may
-+be expressions containing the names @var{mainW}, @var{mainH},
-...@var{overlayw} and @var{overlayH}, for the size of the first and second
++be expressions containing the names @var{main_w}, @var{main_h},
+...@var{overlay_w} and @var{overlay_h}, for the size of the first and second
 +input video, respectively. For example,
 +...@example
-+overlay=mainW-overlayW-10:mainH-overlayH-10
++overlay=main_w-overlay_w-10:main_h-overlay_h-10
 +...@end example
 +can be used to draw the overlay at 10 pixels from the bottom right
 +corner of the main video.
@@ -92,7 +92,7 @@ Index: doc/libavfilter.texi
 +For example, the following command will insert a transparent PNG
 +logo in the bottom left corner of the input video:
 +...@example
-+movie=0:png:logo.png [logo]; [in][logo] overlay=10:mainH-overlayH-10:1 [out]
++movie=0:png:logo.png [logo]; [in][logo] overlay=10:main_h-overlay_h-10:1 [out]
 +...@end example
 +
 +Notice the last parameter to overlay :1 - this enables alpha blending.
@@ -102,8 +102,8 @@ Index: doc/libavfilter.texi
 +...@example
 +movie=0:png:logo1.png [logo1];
 +movie=0:png:logo2.png [logo2];
-+[in][logo1] overlay=10:mainH-overlayH-10:1 [in+logo1];
-+[in+logo1][logo2] overlay=mainW-overlayW-10:mainH-overlayH-10:1 [out]
++[in][logo1] overlay=10:main_h-overlay_h-10:1 [in+logo1];
++[in+logo1][logo2] overlay=main_w-overlay_w-10:main_h-overlay_h-10:1 [out]
 +...@end example
 +
 +You could chain and add more overlays this way but the efficiency of
___
FFmpeg-soc mailing list
FFmpeg-soc@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc


Re: [FFmpeg-soc] [soc]: r5782 - libavfilter/vf_overlay.c

2010-05-11 Thread Baptiste Coudurier

On 05/01/2010 03:44 PM, stefano wrote:

Author: stefano
Date: Sun May  2 00:44:49 2010
New Revision: 5782

Log:
Make config_input_main() use pixdesc.h for computing chroma offsets
and bits per pixel, simplify.

Modified:
libavfilter/vf_overlay.c

Modified: libavfilter/vf_overlay.c
==
--- libavfilter/vf_overlay.cSun May  2 00:17:55 2010(r5781)
+++ libavfilter/vf_overlay.cSun May  2 00:44:49 2010(r5782)
@@ -26,6 +26,7 @@
  #includestdio.h

  #include avfilter.h
+#include libavutil/pixdesc.h
  #include libavcodec/eval.h
  #include libavutil/avstring.h

@@ -108,28 +109,9 @@ static int config_input_main(AVFilterLin
  {
  OverlayContext *over = link-dst-priv;

-switch(link-format) {
-case PIX_FMT_RGB32:
-case PIX_FMT_BGR32:
-over-bpp = 4;
-break;
-case PIX_FMT_RGB24:
-case PIX_FMT_BGR24:
-over-bpp = 3;
-break;
-case PIX_FMT_RGB565:
-case PIX_FMT_RGB555:
-case PIX_FMT_BGR565:
-case PIX_FMT_BGR555:
-case PIX_FMT_GRAY16BE:
-case PIX_FMT_GRAY16LE:
-over-bpp = 2;
-break;
-default:
-over-bpp = 1;
-}
-
-avcodec_get_chroma_sub_sample(link-format,over-hsub,over-vsub);
+over-bpp = (av_get_bits_per_pixel(av_pix_fmt_descriptors[link-format]) + 
7)  3;
+over-hsub = av_pix_fmt_descriptors[link-format].log2_chroma_w;
+over-vsub = av_pix_fmt_descriptors[link-format].log2_chroma_h;



Humm this seems to break the filter.
bpp was 1 for yuv before this change, now it is 2.
bpp is used to offset x from pic-data per component, which seems not 
related to the value av_get_bits_per_pixel returns.


--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer  http://www.ffmpeg.org
___
FFmpeg-soc mailing list
FFmpeg-soc@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc


Re: [FFmpeg-soc] [soc]: r5782 - libavfilter/vf_overlay.c

2010-05-11 Thread Baptiste Coudurier

On 05/01/2010 03:44 PM, stefano wrote:

Author: stefano
Date: Sun May  2 00:44:49 2010
New Revision: 5782

Log:
Make config_input_main() use pixdesc.h for computing chroma offsets
and bits per pixel, simplify.

Modified:
libavfilter/vf_overlay.c

Modified: libavfilter/vf_overlay.c
==
--- libavfilter/vf_overlay.cSun May  2 00:17:55 2010(r5781)
+++ libavfilter/vf_overlay.cSun May  2 00:44:49 2010(r5782)
@@ -26,6 +26,7 @@
  #includestdio.h

  #include avfilter.h
+#include libavutil/pixdesc.h
  #include libavcodec/eval.h
  #include libavutil/avstring.h

@@ -108,28 +109,9 @@ static int config_input_main(AVFilterLin
  {
  OverlayContext *over = link-dst-priv;

-switch(link-format) {
-case PIX_FMT_RGB32:
-case PIX_FMT_BGR32:
-over-bpp = 4;
-break;
-case PIX_FMT_RGB24:
-case PIX_FMT_BGR24:
-over-bpp = 3;
-break;
-case PIX_FMT_RGB565:
-case PIX_FMT_RGB555:
-case PIX_FMT_BGR565:
-case PIX_FMT_BGR555:
-case PIX_FMT_GRAY16BE:
-case PIX_FMT_GRAY16LE:
-over-bpp = 2;
-break;
-default:
-over-bpp = 1;
-}
-
-avcodec_get_chroma_sub_sample(link-format,over-hsub,over-vsub);
+over-bpp = (av_get_bits_per_pixel(av_pix_fmt_descriptors[link-format]) + 
7)  3;
+over-hsub = av_pix_fmt_descriptors[link-format].log2_chroma_w;
+over-vsub = av_pix_fmt_descriptors[link-format].log2_chroma_h;



Humm this seems to break the filter.
bpp was 1 for yuv before this change, now it is 2.
bpp is used to offset x from pic-data per component, which seems not 
related to the value av_get_bits_per_pixel returns.


--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer  http://www.ffmpeg.org
___
FFmpeg-soc mailing list
FFmpeg-soc@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc


Re: [FFmpeg-soc] [PATCH] updated! vf_overlay alpha patch and watermarking using PNG with alpha

2010-05-11 Thread Baptiste Coudurier

On 12/06/2009 08:12 AM, Vitor Sessak wrote:

Hi and sorry for the delay.

Artur Bodera wrote:

On Tue, Dec 1, 2009 at 12:50 AM, Vitor Sessak vitor1...@gmail.com
wrote:


While I normally oppose making non-committed code more complex, I think
this feature is so often requested that it is worth the extra work in
the
future. Stefano, Michael, any strong opinion about this?



I think the vf_overlay should be modified altogether. Although
mathematically alpha-blending is more expensive than opaque pixel
replacement, I think that it should be automatically decided by analyzing
the overlay format.

So the alpha-blending should be a built-in functionality (not a
switchable
parameter) and should be implicitly functional with any overlay
stream/image
that has alpha channel (i.e. rgba). If there is no alpha channel, then
pixel
overriding would be used. This makes much more sense.


I agree that this would be nice, but there is no way to make it work
with the current format negotiation in libavfilter. For example, there
is no way to have a filter that accepts either input: rgb, output rgba
or input: yuv, output: yuva, so I suggest you just do as your present
patch for the time been.


How much harm does doing yuv - yuva or rgb - rgba in all cases ?
To my knowledge it would only be a matter of adding one component and 
memset it to 0xff.


Libswscale should be pretty fast at doing this.

--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer  http://www.ffmpeg.org
___
FFmpeg-soc mailing list
FFmpeg-soc@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc


[FFmpeg-soc] [soc]: r5794 - libavfilter/vf_overlay.c

2010-05-11 Thread stefano
Author: stefano
Date: Wed May 12 01:42:46 2010
New Revision: 5794

Log:
Revert r5782. 

bpp was 1 for yuv before that change, after the change it was 2.
bpp is used to offset x from pic-data per component, which is not
related to the value av_get_bits_per_pixel() returns.

Spotted by Baptiste, +12.353l to me.

Modified:
   libavfilter/vf_overlay.c

Modified: libavfilter/vf_overlay.c
==
--- libavfilter/vf_overlay.cWed May 12 00:00:00 2010(r5793)
+++ libavfilter/vf_overlay.cWed May 12 01:42:46 2010(r5794)
@@ -24,7 +24,6 @@
  */
 
 #include avfilter.h
-#include libavutil/pixdesc.h
 #include libavcodec/eval.h
 #include libavutil/avstring.h
 
@@ -107,9 +106,28 @@ static int config_input_main(AVFilterLin
 {
 OverlayContext *over = link-dst-priv;
 
-over-bpp = (av_get_bits_per_pixel(av_pix_fmt_descriptors[link-format]) 
+ 7)  3;
-over-hsub = av_pix_fmt_descriptors[link-format].log2_chroma_w;
-over-vsub = av_pix_fmt_descriptors[link-format].log2_chroma_h;
+switch(link-format) {
+case PIX_FMT_RGB32:
+case PIX_FMT_BGR32:
+over-bpp = 4;
+break;
+case PIX_FMT_RGB24:
+case PIX_FMT_BGR24:
+over-bpp = 3;
+break;
+case PIX_FMT_RGB565:
+case PIX_FMT_RGB555:
+case PIX_FMT_BGR565:
+case PIX_FMT_BGR555:
+case PIX_FMT_GRAY16BE:
+case PIX_FMT_GRAY16LE:
+over-bpp = 2;
+break;
+default:
+over-bpp = 1;
+}
+
+avcodec_get_chroma_sub_sample(link-format, over-hsub, over-vsub);
 
 return 0;
 }
___
FFmpeg-soc mailing list
FFmpeg-soc@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc


[FFmpeg-soc] [soc]: r5796 - libavfilter/vf_overlay.c

2010-05-11 Thread bcoudurier
Author: bcoudurier
Date: Wed May 12 02:26:33 2010
New Revision: 5796

Log:
add const to pix_fmt arrays

Modified:
   libavfilter/vf_overlay.c

Modified: libavfilter/vf_overlay.c
==
--- libavfilter/vf_overlay.cWed May 12 02:10:58 2010(r5795)
+++ libavfilter/vf_overlay.cWed May 12 02:26:33 2010(r5796)
@@ -84,8 +84,8 @@ static av_cold void uninit(AVFilterConte
 
 static int query_formats(AVFilterContext *ctx)
 {
-enum PixelFormat inout_pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE };
-enum PixelFormat blend_pix_fmts[] = { PIX_FMT_YUVA420P, PIX_FMT_NONE };
+const enum PixelFormat inout_pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE 
};
+const enum PixelFormat blend_pix_fmts[] = { PIX_FMT_YUVA420P, PIX_FMT_NONE 
};
 AVFilterFormats *inout_formats = avfilter_make_format_list(inout_pix_fmts);
 AVFilterFormats *blend_formats = avfilter_make_format_list(blend_pix_fmts);
 
___
FFmpeg-soc mailing list
FFmpeg-soc@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc