#include "i18n.h"
using std::string;
+using std::stringstream;
using std::vector;
using std::list;
+using std::cout;
using boost::shared_ptr;
using boost::lexical_cast;
: Content (o)
, VideoContent (o)
, AudioContent (o)
- , boost::enable_shared_from_this<FFmpegContent> (o)
, _subtitle_streams (o._subtitle_streams)
, _subtitle_stream (o._subtitle_stream)
, _audio_streams (o._audio_streams)
void
FFmpegContent::examine (shared_ptr<Film> film, shared_ptr<Job> job, bool quick)
{
- job->descend (0.5);
- Content::examine (film, job, quick);
- job->ascend ();
-
job->set_progress_unknown ();
+ Content::examine (film, job, quick);
+
shared_ptr<FFmpegDecoder> decoder (new FFmpegDecoder (film, shared_from_this (), true, false, false, true));
ContentVideoFrame video_length = 0;
take_from_video_decoder (decoder);
- Changed (VideoContentProperty::VIDEO_LENGTH);
- Changed (FFmpegContentProperty::SUBTITLE_STREAMS);
- Changed (FFmpegContentProperty::SUBTITLE_STREAM);
- Changed (FFmpegContentProperty::AUDIO_STREAMS);
- Changed (FFmpegContentProperty::AUDIO_STREAM);
+ signal_changed (VideoContentProperty::VIDEO_LENGTH);
+ signal_changed (FFmpegContentProperty::SUBTITLE_STREAMS);
+ signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
+ signal_changed (FFmpegContentProperty::AUDIO_STREAMS);
+ signal_changed (FFmpegContentProperty::AUDIO_STREAM);
+ signal_changed (AudioContentProperty::AUDIO_CHANNELS);
}
string
FFmpegContent::summary () const
{
- return String::compose (_("Movie: %1"), file().filename ());
+ return String::compose (_("Movie: %1"), file().filename().string());
+}
+
+string
+FFmpegContent::information () const
+{
+ if (video_length() == 0 || video_frame_rate() == 0) {
+ return "";
+ }
+
+ stringstream s;
+
+ s << String::compose (_("%1 frames; %2 frames per second"), video_length(), video_frame_rate()) << "\n";
+ s << VideoContent::information ();
+
+ return s.str ();
}
void
_subtitle_stream = s;
}
- Changed (FFmpegContentProperty::SUBTITLE_STREAM);
+ signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
}
void
_audio_stream = s;
}
- Changed (FFmpegContentProperty::AUDIO_STREAM);
+ signal_changed (FFmpegContentProperty::AUDIO_STREAM);
}
ContentAudioFrame
return 0;
}
- return _audio_stream->channels ();
+ return _audio_stream->channels;
}
int
return _audio_stream->frame_rate;
}
-int64_t
-FFmpegContent::audio_channel_layout () const
-{
- if (!_audio_stream) {
- return 0;
- }
-
- return _audio_stream->channel_layout;
-}
-
bool
operator== (FFmpegSubtitleStream const & a, FFmpegSubtitleStream const & b)
{
name = node->string_child ("Name");
id = node->number_child<int> ("Id");
frame_rate = node->number_child<int> ("FrameRate");
- channel_layout = node->number_child<int64_t> ("ChannelLayout");
+ channels = node->number_child<int64_t> ("Channels");
}
void
root->add_child("Name")->add_child_text (name);
root->add_child("Id")->add_child_text (lexical_cast<string> (id));
root->add_child("FrameRate")->add_child_text (lexical_cast<string> (frame_rate));
- root->add_child("ChannelLayout")->add_child_text (lexical_cast<string> (channel_layout));
+ root->add_child("Channels")->add_child_text (lexical_cast<string> (channels));
}
/** Construct a SubtitleStream from a value returned from to_string().