[FFmpeg-cvslog] r10868 - in trunk/libavformat: Makefile crc.c framecrcenc.c

aurel subversion
Sun Oct 28 23:08:10 CET 2007


Author: aurel
Date: Sun Oct 28 23:08:09 2007
New Revision: 10868

Log:
move framecrc muxer in its own file

Added:
   trunk/libavformat/framecrcenc.c
      - copied, changed from r10867, /trunk/libavformat/crc.c
Modified:
   trunk/libavformat/Makefile
   trunk/libavformat/crc.c

Modified: trunk/libavformat/Makefile
==============================================================================
--- trunk/libavformat/Makefile	(original)
+++ trunk/libavformat/Makefile	Sun Oct 28 23:08:09 2007
@@ -50,7 +50,7 @@ OBJS-$(CONFIG_FLIC_DEMUXER)             
 OBJS-$(CONFIG_FLV_DEMUXER)               += flvdec.o
 OBJS-$(CONFIG_FLV_MUXER)                 += flvenc.o
 OBJS-$(CONFIG_FOURXM_DEMUXER)            += 4xm.o
-OBJS-$(CONFIG_FRAMECRC_MUXER)            += crc.o
+OBJS-$(CONFIG_FRAMECRC_MUXER)            += framecrcenc.o
 OBJS-$(CONFIG_GIF_MUXER)                 += gif.o
 OBJS-$(CONFIG_GIF_DEMUXER)               += gifdec.o
 OBJS-$(CONFIG_GXF_DEMUXER)               += gxf.o

Modified: trunk/libavformat/crc.c
==============================================================================
--- trunk/libavformat/crc.c	(original)
+++ trunk/libavformat/crc.c	Sun Oct 28 23:08:09 2007
@@ -1,5 +1,5 @@
 /*
- * CRC decoder (for codec/format testing)
+ * CRC encoder (for codec/format testing)
  * Copyright (c) 2002 Fabrice Bellard.
  *
  * This file is part of FFmpeg.
@@ -21,7 +21,6 @@
 #include "avformat.h"
 #include "adler32.h"
 
-#ifdef CONFIG_CRC_MUXER
 typedef struct CRCState {
     uint32_t crcval;
 } CRCState;
@@ -53,22 +52,7 @@ static int crc_write_trailer(struct AVFo
     put_flush_packet(&s->pb);
     return 0;
 }
-#endif
-
-#ifdef CONFIG_FRAMECRC_MUXER
-static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    uint32_t crc = av_adler32_update(0, pkt->data, pkt->size);
-    char buf[256];
-
-    snprintf(buf, sizeof(buf), "%d, %"PRId64", %d, 0x%08x\n", pkt->stream_index, pkt->dts, pkt->size, crc);
-    put_buffer(&s->pb, buf, strlen(buf));
-    put_flush_packet(&s->pb);
-    return 0;
-}
-#endif
 
-#ifdef CONFIG_CRC_MUXER
 AVOutputFormat crc_muxer = {
     "crc",
     "crc testing format",
@@ -81,18 +65,3 @@ AVOutputFormat crc_muxer = {
     crc_write_packet,
     crc_write_trailer,
 };
-#endif
-#ifdef CONFIG_FRAMECRC_MUXER
-AVOutputFormat framecrc_muxer = {
-    "framecrc",
-    "framecrc testing format",
-    NULL,
-    "",
-    0,
-    CODEC_ID_PCM_S16LE,
-    CODEC_ID_RAWVIDEO,
-    NULL,
-    framecrc_write_packet,
-    NULL,
-};
-#endif

Copied: trunk/libavformat/framecrcenc.c (from r10867, /trunk/libavformat/crc.c)
==============================================================================
--- /trunk/libavformat/crc.c	(original)
+++ trunk/libavformat/framecrcenc.c	Sun Oct 28 23:08:09 2007
@@ -1,5 +1,5 @@
 /*
- * CRC decoder (for codec/format testing)
+ * frame CRC encoder (for codec/format testing)
  * Copyright (c) 2002 Fabrice Bellard.
  *
  * This file is part of FFmpeg.
@@ -21,41 +21,6 @@
 #include "avformat.h"
 #include "adler32.h"
 
-#ifdef CONFIG_CRC_MUXER
-typedef struct CRCState {
-    uint32_t crcval;
-} CRCState;
-
-static int crc_write_header(struct AVFormatContext *s)
-{
-    CRCState *crc = s->priv_data;
-
-    /* init CRC */
-    crc->crcval = 1;
-
-    return 0;
-}
-
-static int crc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
-{
-    CRCState *crc = s->priv_data;
-    crc->crcval = av_adler32_update(crc->crcval, pkt->data, pkt->size);
-    return 0;
-}
-
-static int crc_write_trailer(struct AVFormatContext *s)
-{
-    CRCState *crc = s->priv_data;
-    char buf[64];
-
-    snprintf(buf, sizeof(buf), "CRC=0x%08x\n", crc->crcval);
-    put_buffer(&s->pb, buf, strlen(buf));
-    put_flush_packet(&s->pb);
-    return 0;
-}
-#endif
-
-#ifdef CONFIG_FRAMECRC_MUXER
 static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
 {
     uint32_t crc = av_adler32_update(0, pkt->data, pkt->size);
@@ -66,23 +31,7 @@ static int framecrc_write_packet(struct 
     put_flush_packet(&s->pb);
     return 0;
 }
-#endif
 
-#ifdef CONFIG_CRC_MUXER
-AVOutputFormat crc_muxer = {
-    "crc",
-    "crc testing format",
-    NULL,
-    "",
-    sizeof(CRCState),
-    CODEC_ID_PCM_S16LE,
-    CODEC_ID_RAWVIDEO,
-    crc_write_header,
-    crc_write_packet,
-    crc_write_trailer,
-};
-#endif
-#ifdef CONFIG_FRAMECRC_MUXER
 AVOutputFormat framecrc_muxer = {
     "framecrc",
     "framecrc testing format",
@@ -95,4 +44,3 @@ AVOutputFormat framecrc_muxer = {
     framecrc_write_packet,
     NULL,
 };
-#endif




More information about the ffmpeg-cvslog mailing list