Requested-by: Baptiste Coudurier
Approved-by: David Conrad
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
| ... | ... |
@@ -296,7 +296,7 @@ OBJS-$(CONFIG_SWF_DEMUXER) += swfdec.o |
| 296 | 296 |
OBJS-$(CONFIG_SWF_MUXER) += swfenc.o |
| 297 | 297 |
OBJS-$(CONFIG_THP_DEMUXER) += thp.o |
| 298 | 298 |
OBJS-$(CONFIG_TIERTEXSEQ_DEMUXER) += tiertexseq.o |
| 299 |
-OBJS-$(CONFIG_TIMECODE_V2_MUXER) += timecode_v2.o |
|
| 299 |
+OBJS-$(CONFIG_MKVTIMESTAMP_V2_MUXER) += mkvtimestamp_v2.o |
|
| 300 | 300 |
OBJS-$(CONFIG_TMV_DEMUXER) += tmv.o |
| 301 | 301 |
OBJS-$(CONFIG_TRUEHD_DEMUXER) += rawdec.o |
| 302 | 302 |
OBJS-$(CONFIG_TRUEHD_MUXER) += rawenc.o |
| ... | ... |
@@ -219,7 +219,7 @@ void av_register_all(void) |
| 219 | 219 |
REGISTER_MUXER (TGP, tgp); |
| 220 | 220 |
REGISTER_DEMUXER (THP, thp); |
| 221 | 221 |
REGISTER_DEMUXER (TIERTEXSEQ, tiertexseq); |
| 222 |
- REGISTER_MUXER (TIMECODE_V2, timecode_v2); |
|
| 222 |
+ REGISTER_MUXER (MKVTIMESTAMP_V2, mkvtimestamp_v2); |
|
| 223 | 223 |
REGISTER_DEMUXER (TMV, tmv); |
| 224 | 224 |
REGISTER_MUXDEMUX (TRUEHD, truehd); |
| 225 | 225 |
REGISTER_DEMUXER (TTA, tta); |
| 226 | 226 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,53 @@ |
| 0 |
+/* |
|
| 1 |
+ * extract pts as timecode v2, as defined by mkvtoolnix |
|
| 2 |
+ * Copyright (c) 2009 David Conrad |
|
| 3 |
+ * |
|
| 4 |
+ * This file is part of FFmpeg. |
|
| 5 |
+ * |
|
| 6 |
+ * FFmpeg is free software; you can redistribute it and/or |
|
| 7 |
+ * modify it under the terms of the GNU Lesser General Public |
|
| 8 |
+ * License as published by the Free Software Foundation; either |
|
| 9 |
+ * version 2.1 of the License, or (at your option) any later version. |
|
| 10 |
+ * |
|
| 11 |
+ * FFmpeg is distributed in the hope that it will be useful, |
|
| 12 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 13 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
| 14 |
+ * Lesser General Public License for more details. |
|
| 15 |
+ * |
|
| 16 |
+ * You should have received a copy of the GNU Lesser General Public |
|
| 17 |
+ * License along with FFmpeg; if not, write to the Free Software |
|
| 18 |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
| 19 |
+ */ |
|
| 20 |
+ |
|
| 21 |
+#include "avformat.h" |
|
| 22 |
+ |
|
| 23 |
+static int write_header(AVFormatContext *s) |
|
| 24 |
+{
|
|
| 25 |
+ static const char *header = "# timecode format v2\n"; |
|
| 26 |
+ put_buffer(s->pb, header, strlen(header)); |
|
| 27 |
+ av_set_pts_info(s->streams[0], 64, 1, 1000); |
|
| 28 |
+ return 0; |
|
| 29 |
+} |
|
| 30 |
+ |
|
| 31 |
+static int write_packet(AVFormatContext *s, AVPacket *pkt) |
|
| 32 |
+{
|
|
| 33 |
+ char buf[256]; |
|
| 34 |
+ if (pkt->stream_index) |
|
| 35 |
+ av_log(s, AV_LOG_WARNING, "More than one stream unsupported\n"); |
|
| 36 |
+ snprintf(buf, sizeof(buf), "%" PRId64 "\n", pkt->dts); |
|
| 37 |
+ put_buffer(s->pb, buf, strlen(buf)); |
|
| 38 |
+ put_flush_packet(s->pb); |
|
| 39 |
+ return 0; |
|
| 40 |
+} |
|
| 41 |
+ |
|
| 42 |
+AVOutputFormat ff_mkvtimestamp_v2_muxer = {
|
|
| 43 |
+ "mkvtimestamp_v2", |
|
| 44 |
+ NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
|
|
| 45 |
+ NULL, |
|
| 46 |
+ "", |
|
| 47 |
+ 0, |
|
| 48 |
+ CODEC_ID_NONE, |
|
| 49 |
+ CODEC_ID_RAWVIDEO, |
|
| 50 |
+ write_header, |
|
| 51 |
+ write_packet, |
|
| 52 |
+}; |
| 0 | 53 |
deleted file mode 100644 |
| ... | ... |
@@ -1,53 +0,0 @@ |
| 1 |
-/* |
|
| 2 |
- * extract pts as timecode v2, as defined by mkvtoolnix |
|
| 3 |
- * Copyright (c) 2009 David Conrad |
|
| 4 |
- * |
|
| 5 |
- * This file is part of FFmpeg. |
|
| 6 |
- * |
|
| 7 |
- * FFmpeg is free software; you can redistribute it and/or |
|
| 8 |
- * modify it under the terms of the GNU Lesser General Public |
|
| 9 |
- * License as published by the Free Software Foundation; either |
|
| 10 |
- * version 2.1 of the License, or (at your option) any later version. |
|
| 11 |
- * |
|
| 12 |
- * FFmpeg is distributed in the hope that it will be useful, |
|
| 13 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 14 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
| 15 |
- * Lesser General Public License for more details. |
|
| 16 |
- * |
|
| 17 |
- * You should have received a copy of the GNU Lesser General Public |
|
| 18 |
- * License along with FFmpeg; if not, write to the Free Software |
|
| 19 |
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
| 20 |
- */ |
|
| 21 |
- |
|
| 22 |
-#include "avformat.h" |
|
| 23 |
- |
|
| 24 |
-static int write_header(AVFormatContext *s) |
|
| 25 |
-{
|
|
| 26 |
- static const char *header = "# timecode format v2\n"; |
|
| 27 |
- put_buffer(s->pb, header, strlen(header)); |
|
| 28 |
- av_set_pts_info(s->streams[0], 64, 1, 1000); |
|
| 29 |
- return 0; |
|
| 30 |
-} |
|
| 31 |
- |
|
| 32 |
-static int write_packet(AVFormatContext *s, AVPacket *pkt) |
|
| 33 |
-{
|
|
| 34 |
- char buf[256]; |
|
| 35 |
- if (pkt->stream_index) |
|
| 36 |
- av_log(s, AV_LOG_WARNING, "More than one stream unsupported\n"); |
|
| 37 |
- snprintf(buf, sizeof(buf), "%" PRId64 "\n", pkt->dts); |
|
| 38 |
- put_buffer(s->pb, buf, strlen(buf)); |
|
| 39 |
- put_flush_packet(s->pb); |
|
| 40 |
- return 0; |
|
| 41 |
-} |
|
| 42 |
- |
|
| 43 |
-AVOutputFormat ff_timecode_v2_muxer = {
|
|
| 44 |
- "timecode_v2", |
|
| 45 |
- NULL_IF_CONFIG_SMALL("timecode format v2"),
|
|
| 46 |
- NULL, |
|
| 47 |
- "", |
|
| 48 |
- 0, |
|
| 49 |
- CODEC_ID_NONE, |
|
| 50 |
- CODEC_ID_RAWVIDEO, |
|
| 51 |
- write_header, |
|
| 52 |
- write_packet, |
|
| 53 |
-}; |