From 09a9ac376db005a40a351736bcff4077f098825d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 26 Jun 2013 01:21:21 +0100 Subject: [PATCH] Another try at sorting out the thorny question of timing. --- doc/design/timing.tex | 42 +++ src/lib/audio_content.h | 4 +- src/lib/audio_decoder.cc | 101 +---- src/lib/audio_decoder.h | 25 +- src/lib/audio_sink.h | 32 -- src/lib/audio_source.cc | 42 --- src/lib/audio_source.h | 43 --- src/lib/black_decoder.cc | 102 ------ src/lib/black_decoder.h | 48 --- src/lib/combiner.cc | 65 ---- src/lib/combiner.h | 43 --- src/lib/decoder.h | 20 - src/lib/encoder.cc | 4 +- src/lib/encoder.h | 8 +- src/lib/ffmpeg_content.cc | 12 +- src/lib/ffmpeg_content.h | 9 +- src/lib/ffmpeg_decoder.cc | 144 +++++--- src/lib/ffmpeg_decoder.h | 12 +- src/lib/ffmpeg_examiner.cc | 14 +- src/lib/ffmpeg_examiner.h | 8 +- src/lib/image.cc | 5 +- src/lib/imagemagick_content.cc | 2 +- src/lib/imagemagick_content.h | 2 +- src/lib/imagemagick_decoder.cc | 41 +-- src/lib/imagemagick_decoder.h | 4 +- src/lib/imagemagick_examiner.h | 2 +- src/lib/matcher.cc | 224 ------------ src/lib/matcher.h | 77 ---- src/lib/null_content.h | 67 ---- src/lib/player.cc | 346 +++++++++++------- src/lib/player.h | 47 ++- src/lib/playlist.h | 4 - src/lib/resampler.cc | 61 +++ src/lib/resampler.h | 21 ++ src/lib/silence_decoder.cc | 87 ----- src/lib/silence_decoder.h | 37 -- src/lib/sndfile_content.cc | 2 +- src/lib/sndfile_content.h | 4 +- src/lib/sndfile_decoder.cc | 12 +- src/lib/sndfile_decoder.h | 10 +- src/lib/subtitle.cc | 3 +- src/lib/transcoder.cc | 23 +- src/lib/types.h | 2 - src/lib/util.cc | 2 +- src/lib/util.h | 3 +- src/lib/video_content.cc | 5 +- src/lib/video_content.h | 9 +- src/lib/video_decoder.cc | 107 +----- src/lib/video_decoder.h | 35 +- src/lib/video_examiner.h | 3 +- src/lib/video_sink.h | 39 -- src/lib/video_source.cc | 44 --- src/lib/video_source.h | 52 --- src/lib/writer.cc | 1 - src/lib/wscript | 7 +- src/wx/film_viewer.cc | 5 +- test/ffmpeg_examiner_test.cc | 4 +- .../ffmpeg_pts_offset.cc | 46 +-- test/test.cc | 1 + 59 files changed, 625 insertions(+), 1599 deletions(-) create mode 100644 doc/design/timing.tex delete mode 100644 src/lib/audio_sink.h delete mode 100644 src/lib/audio_source.cc delete mode 100644 src/lib/audio_source.h delete mode 100644 src/lib/black_decoder.cc delete mode 100644 src/lib/black_decoder.h delete mode 100644 src/lib/combiner.cc delete mode 100644 src/lib/combiner.h delete mode 100644 src/lib/matcher.cc delete mode 100644 src/lib/matcher.h delete mode 100644 src/lib/null_content.h create mode 100644 src/lib/resampler.cc create mode 100644 src/lib/resampler.h delete mode 100644 src/lib/silence_decoder.cc delete mode 100644 src/lib/silence_decoder.h delete mode 100644 src/lib/video_sink.h delete mode 100644 src/lib/video_source.cc delete mode 100644 src/lib/video_source.h rename src/lib/null_content.cc => test/ffmpeg_pts_offset.cc (50%) diff --git a/doc/design/timing.tex b/doc/design/timing.tex new file mode 100644 index 000000000..567ba024f --- /dev/null +++ b/doc/design/timing.tex @@ -0,0 +1,42 @@ +\documentclass{article} +\begin{document} + +We are trying to implement full-ish playlist based content specification. The timing is awkward. + +\section{Reference timing} + +Frame rates of things can vary a lot; content can be in pretty much +anything, and DCP video and audio frame rates may change on a whim +depending on what is best for a given set of content. This suggests +(albeit without strong justification) the need for a frame-rate-independent unit of time. + +So far we've been using a time type called \texttt{Time} expressed in +$\mathtt{TIME\_HZ}^{-1}$; e.g. \texttt{TIME\_HZ} units is 1 second. +\texttt{TIME\_HZ} is chosen to be divisible by lots of frame and +sample rates. + +We express content start time as a \texttt{Time}. + + +\section{Timing at different stages of the chain} + +Let's try this: decoders produce sequences of (perhaps) video frames +and (perhaps) audio frames. There are no gaps. They are at the +content's native frame rates and are synchronised (meaning that if +they are played together, at the content's frame rates, they will be +in sync). The decoders give timestamps for each piece of their +output, which are \emph{simple indices} (\texttt{ContentVideoFrame} +and \texttt{ContentAudioFrame}). Decoders know nothing of \texttt{Time}. + + +\section{Split of stuff between decoders and player} + +In some ways it seems nice to have decoders which produce the rawest +possible data and make the player sort it out (e.g.\ cropping and +scaling video, resampling audio). The resampling is awkward, though, +as you really need one resampler per source. So it might make more sense +to put stuff in the decoder. But then, what's one map of resamplers between friends? + + + +\end{document} diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index 73a00ca7d..9bf53e0ab 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -41,6 +41,8 @@ public: class AudioContent : public virtual Content { public: + typedef int64_t Frame; + AudioContent (boost::shared_ptr, Time); AudioContent (boost::shared_ptr, boost::filesystem::path); AudioContent (boost::shared_ptr, boost::shared_ptr); @@ -49,7 +51,7 @@ public: void as_xml (xmlpp::Node *) const; virtual int audio_channels () const = 0; - virtual ContentAudioFrame audio_length () const = 0; + virtual AudioContent::Frame audio_length () const = 0; virtual int content_audio_frame_rate () const = 0; virtual int output_audio_frame_rate () const = 0; virtual AudioMapping audio_mapping () const = 0; diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index a9e01908c..dc49a1846 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -31,57 +31,12 @@ using std::cout; using boost::optional; using boost::shared_ptr; -AudioDecoder::AudioDecoder (shared_ptr f, shared_ptr c) +AudioDecoder::AudioDecoder (shared_ptr f) : Decoder (f) - , _next_audio (0) - , _audio_content (c) + , _audio_position (0) { - if (_audio_content->content_audio_frame_rate() != _audio_content->output_audio_frame_rate()) { - - shared_ptr film = _film.lock (); - assert (film); - - stringstream s; - s << String::compose ( - "Will resample audio from %1 to %2", - _audio_content->content_audio_frame_rate(), _audio_content->output_audio_frame_rate() - ); - - film->log()->log (s.str ()); - - /* We will be using planar float data when we call the - resampler. As far as I can see, the audio channel - layout is not necessary for our purposes; it seems - only to be used get the number of channels and - decide if rematrixing is needed. It won't be, since - input and output layouts are the same. - */ - - _swr_context = swr_alloc_set_opts ( - 0, - av_get_default_channel_layout (_audio_content->audio_channels ()), - AV_SAMPLE_FMT_FLTP, - _audio_content->output_audio_frame_rate(), - av_get_default_channel_layout (_audio_content->audio_channels ()), - AV_SAMPLE_FMT_FLTP, - _audio_content->content_audio_frame_rate(), - 0, 0 - ); - - swr_init (_swr_context); - } else { - _swr_context = 0; - } } -AudioDecoder::~AudioDecoder () -{ - if (_swr_context) { - swr_free (&_swr_context); - } -} - - #if 0 void AudioDecoder::process_end () @@ -113,54 +68,8 @@ AudioDecoder::process_end () #endif void -AudioDecoder::audio (shared_ptr data, Time time) -{ - /* Maybe resample */ - if (_swr_context) { - - /* Compute the resampled frames count and add 32 for luck */ - int const max_resampled_frames = ceil ( - (int64_t) data->frames() * _audio_content->output_audio_frame_rate() / _audio_content->content_audio_frame_rate() - ) + 32; - - shared_ptr resampled (new AudioBuffers (data->channels(), max_resampled_frames)); - - /* Resample audio */ - int const resampled_frames = swr_convert ( - _swr_context, (uint8_t **) resampled->data(), max_resampled_frames, (uint8_t const **) data->data(), data->frames() - ); - - if (resampled_frames < 0) { - throw EncodeError (_("could not run sample-rate converter")); - } - - resampled->set_frames (resampled_frames); - - /* And point our variables at the resampled audio */ - data = resampled; - } - - shared_ptr film = _film.lock (); - assert (film); - - /* Remap channels */ - shared_ptr dcp_mapped (new AudioBuffers (film->dcp_audio_channels(), data->frames())); - dcp_mapped->make_silent (); - list > map = _audio_content->audio_mapping().content_to_dcp (); - for (list >::iterator i = map.begin(); i != map.end(); ++i) { - dcp_mapped->accumulate_channel (data.get(), i->first, i->second); - } - - Audio (dcp_mapped, time); - _next_audio = time + film->audio_frames_to_time (data->frames()); -} - -bool -AudioDecoder::audio_done () const +AudioDecoder::audio (shared_ptr data, AudioContent::Frame frame) { - shared_ptr film = _film.lock (); - assert (film); - - return (_audio_content->length() - _next_audio) < film->audio_frames_to_time (1); + Audio (data, frame); + _audio_position = frame + data->frames (); } - diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 1da8a676f..ddfb296c9 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -24,33 +24,26 @@ #ifndef DCPOMATIC_AUDIO_DECODER_H #define DCPOMATIC_AUDIO_DECODER_H -#include "audio_source.h" #include "decoder.h" -extern "C" { -#include -} +#include "content.h" -class AudioContent; +class AudioBuffers; /** @class AudioDecoder. * @brief Parent class for audio decoders. */ -class AudioDecoder : public AudioSource, public virtual Decoder +class AudioDecoder : public virtual Decoder { public: - AudioDecoder (boost::shared_ptr, boost::shared_ptr); - ~AudioDecoder (); + AudioDecoder (boost::shared_ptr); -protected: - - void audio (boost::shared_ptr, Time); - bool audio_done () const; + /** Emitted when some audio data is ready */ + boost::signals2::signal, AudioContent::Frame)> Audio; - Time _next_audio; - boost::shared_ptr _audio_content; +protected: -private: - SwrContext* _swr_context; + void audio (boost::shared_ptr, AudioContent::Frame); + AudioContent::Frame _audio_position; }; #endif diff --git a/src/lib/audio_sink.h b/src/lib/audio_sink.h deleted file mode 100644 index 1aad5edf9..000000000 --- a/src/lib/audio_sink.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifndef DCPOMATIC_AUDIO_SINK_H -#define DCPOMATIC_AUDIO_SINK_H - -class AudioBuffers; - -class AudioSink -{ -public: - /** Call with some audio data */ - virtual void process_audio (boost::shared_ptr, Time) = 0; -}; - -#endif diff --git a/src/lib/audio_source.cc b/src/lib/audio_source.cc deleted file mode 100644 index e61721646..000000000 --- a/src/lib/audio_source.cc +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include "audio_source.h" -#include "audio_sink.h" - -using boost::shared_ptr; -using boost::weak_ptr; -using boost::bind; - -static void -process_audio_proxy (weak_ptr sink, shared_ptr audio, Time time) -{ - shared_ptr p = sink.lock (); - if (p) { - p->process_audio (audio, time); - } -} - -void -AudioSource::connect_audio (shared_ptr s) -{ - Audio.connect (bind (process_audio_proxy, weak_ptr (s), _1, _2)); -} - - diff --git a/src/lib/audio_source.h b/src/lib/audio_source.h deleted file mode 100644 index ef47e969b..000000000 --- a/src/lib/audio_source.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -/** @file src/audio_source.h - * @brief Parent class for classes which emit audio data. - */ - -#ifndef DCPOMATIC_AUDIO_SOURCE_H -#define DCPOMATIC_AUDIO_SOURCE_H - -#include -#include "types.h" - -class AudioBuffers; -class AudioSink; - -/** A class that emits audio data */ -class AudioSource -{ -public: - /** Emitted when some audio data is ready */ - boost::signals2::signal, Time)> Audio; - - void connect_audio (boost::shared_ptr); -}; - -#endif diff --git a/src/lib/black_decoder.cc b/src/lib/black_decoder.cc deleted file mode 100644 index 0b231edd3..000000000 --- a/src/lib/black_decoder.cc +++ /dev/null @@ -1,102 +0,0 @@ -/* - Copyright (C) 2013 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include "black_decoder.h" -#include "image.h" -#include "null_content.h" - -using boost::shared_ptr; - -BlackDecoder::BlackDecoder (shared_ptr f, shared_ptr c) - : Decoder (f) - , VideoDecoder (f, c) -{ - -} - -void -BlackDecoder::pass () -{ - if (!_image) { - _image.reset (new SimpleImage (AV_PIX_FMT_RGB24, video_size(), true)); - _image->make_black (); - video (_image, false, _next_video); - } else { - video (_image, true, _next_video); - } -} - -float -BlackDecoder::video_frame_rate () const -{ - boost::shared_ptr f = _film.lock (); - if (!f) { - return 24; - } - - return f->dcp_video_frame_rate (); -} - -ContentVideoFrame -BlackDecoder::video_length () const -{ - return _video_content->length() * video_frame_rate() / TIME_HZ; -} - -Time -BlackDecoder::position () const -{ - return _next_video; -} - -void -BlackDecoder::seek (Time t) -{ - _next_video = t; -} - -void -BlackDecoder::seek_back () -{ - boost::shared_ptr f = _film.lock (); - if (!f) { - return; - } - - _next_video -= f->video_frames_to_time (2); -} - -void -BlackDecoder::seek_forward () -{ - boost::shared_ptr f = _film.lock (); - if (!f) { - return; - } - - _next_video += f->video_frames_to_time (1); -} - -bool -BlackDecoder::done () const -{ - return video_done (); -} - - diff --git a/src/lib/black_decoder.h b/src/lib/black_decoder.h deleted file mode 100644 index 4591881a1..000000000 --- a/src/lib/black_decoder.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2013 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include "video_decoder.h" - -class NullContent; - -class BlackDecoder : public VideoDecoder -{ -public: - BlackDecoder (boost::shared_ptr, boost::shared_ptr); - - /* Decoder */ - - void pass (); - void seek (Time); - void seek_back (); - void seek_forward (); - Time position () const; - bool done () const; - - /* VideoDecoder */ - - float video_frame_rate () const; - libdcp::Size video_size () const { - return libdcp::Size (256, 256); - } - ContentVideoFrame video_length () const; - -private: - boost::shared_ptr _image; -}; diff --git a/src/lib/combiner.cc b/src/lib/combiner.cc deleted file mode 100644 index 44971d135..000000000 --- a/src/lib/combiner.cc +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include "combiner.h" -#include "image.h" - -using boost::shared_ptr; - -Combiner::Combiner () -{ - -} - -/** Process video for the left half of the frame. - * Subtitle parameter will be ignored. - * @param image Frame image. - */ -void -Combiner::process_video (shared_ptr image, bool, Time) -{ - _image.reset (new SimpleImage (image, true)); -} - -/** Process video for the right half of the frame. - * @param image Frame image. - * @param sub Subtitle (which will be put onto the whole frame) - */ -void -Combiner::process_video_b (shared_ptr image, bool, Time t) -{ - /* Copy the right half of this image into our _image */ - /* XXX: this should probably be in the Image class */ - for (int i = 0; i < image->components(); ++i) { - int const line_size = image->line_size()[i]; - int const half_line_size = line_size / 2; - - uint8_t* p = _image->data()[i]; - uint8_t* q = image->data()[i]; - - for (int j = 0; j < image->lines (i); ++j) { - memcpy (p + half_line_size, q + half_line_size, half_line_size); - p += _image->stride()[i]; - q += image->stride()[i]; - } - } - - Video (_image, false, t); - _image.reset (); -} diff --git a/src/lib/combiner.h b/src/lib/combiner.h deleted file mode 100644 index 46c90b4d8..000000000 --- a/src/lib/combiner.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -/** @file src/lib/combiner.h - * @brief Class for combining two video streams. - */ - -#include "video_source.h" -#include "video_sink.h" - -/** @class Combiner - * @brief A class which can combine two video streams into one, with - * one image used for the left half of the screen and the other for - * the right. - */ -class Combiner : public VideoSource, public VideoSink -{ -public: - Combiner (); - - void process_video (boost::shared_ptr i, bool, Time); - void process_video_b (boost::shared_ptr i, bool, Time); - -private: - /** The image that we are currently working on */ - boost::shared_ptr _image; -}; diff --git a/src/lib/decoder.h b/src/lib/decoder.h index 391b9d19a..cfca6867f 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -29,8 +29,6 @@ #include #include #include -#include "video_source.h" -#include "audio_source.h" #include "film.h" class Image; @@ -54,24 +52,6 @@ public: */ virtual void pass () = 0; - /** Seek this decoder to as close as possible to some time, - * expressed relative to our source's start. - * @param t Time. - * @param a true to try hard to be accurate, otherwise false. - */ - virtual void seek (Time) = 0; - - /** Seek back one video frame */ - virtual void seek_back () = 0; - - /** Seek forward one video frame */ - virtual void seek_forward () = 0; - - /** @return Approximate time of the next content that we will emit, - * expressed relative to the start of our source. - */ - virtual Time position () const = 0; - virtual bool done () const = 0; protected: diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 8b2db0eb3..c3865d2c1 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -169,7 +169,7 @@ Encoder::frame_done () } void -Encoder::process_video (shared_ptr image, bool same, Time) +Encoder::process_video (shared_ptr image, bool same) { boost::mutex::scoped_lock lock (_mutex); @@ -215,7 +215,7 @@ Encoder::process_video (shared_ptr image, bool same, Time) } void -Encoder::process_audio (shared_ptr data, Time) +Encoder::process_audio (shared_ptr data) { _writer->write (data); } diff --git a/src/lib/encoder.h b/src/lib/encoder.h index 3fe707b51..b5a641f50 100644 --- a/src/lib/encoder.h +++ b/src/lib/encoder.h @@ -36,8 +36,6 @@ extern "C" { #include } #include "util.h" -#include "video_sink.h" -#include "audio_sink.h" class Image; class AudioBuffers; @@ -55,7 +53,7 @@ class Job; * is supplied as uncompressed PCM in blocks of various sizes. */ -class Encoder : public VideoSink, public AudioSink +class Encoder { public: Encoder (boost::shared_ptr f, boost::shared_ptr); @@ -68,10 +66,10 @@ public: * @param i Video frame image. * @param same true if i is the same as the last time we were called. */ - void process_video (boost::shared_ptr i, bool same, Time); + void process_video (boost::shared_ptr i, bool same); /** Call with some audio data */ - void process_audio (boost::shared_ptr, Time); + void process_audio (boost::shared_ptr); /** Called when a processing run has finished */ void process_end (); diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 68132c5ab..1135cc9a3 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -139,7 +139,7 @@ FFmpegContent::examine (shared_ptr job) shared_ptr examiner (new FFmpegExaminer (shared_from_this ())); - ContentVideoFrame video_length = 0; + VideoContent::Frame video_length = 0; video_length = examiner->video_length (); film->log()->log (String::compose ("Video length obtained from header as %1 frames", video_length)); @@ -214,12 +214,12 @@ FFmpegContent::set_audio_stream (shared_ptr s) signal_changed (FFmpegContentProperty::AUDIO_STREAM); } -ContentAudioFrame +AudioContent::Frame FFmpegContent::audio_length () const { int const cafr = content_audio_frame_rate (); int const vfr = video_frame_rate (); - ContentVideoFrame const vl = video_length (); + VideoContent::Frame const vl = video_length (); boost::mutex::scoped_lock lm (_mutex); if (!_audio_stream) { @@ -296,7 +296,7 @@ FFmpegAudioStream::FFmpegAudioStream (shared_ptr node) frame_rate = node->number_child ("FrameRate"); channels = node->number_child ("Channels"); mapping = AudioMapping (node->node_child ("Mapping")); - start = node->optional_number_child