diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-04-02 23:33:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-04-02 23:33:46 +0100 |
| commit | 7ebb57db2013c9e929d44d0e547ab1f27c59cc7f (patch) | |
| tree | 19959172e24e2cf097a2814aeb9e2298805d8a2b /src/lib/video_content.cc | |
| parent | 2343509c75673d3fad82a5d0eab9622a4d6902e3 (diff) | |
Add basic content information, and some other bits.
Diffstat (limited to 'src/lib/video_content.cc')
| -rw-r--r-- | src/lib/video_content.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index f48813f60..edb713466 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -2,11 +2,15 @@ #include "video_content.h" #include "video_decoder.h" +#include "i18n.h" + int const VideoContentProperty::VIDEO_LENGTH = 0; int const VideoContentProperty::VIDEO_SIZE = 1; int const VideoContentProperty::VIDEO_FRAME_RATE = 2; using std::string; +using std::stringstream; +using std::setprecision; using boost::shared_ptr; using boost::lexical_cast; @@ -61,3 +65,19 @@ VideoContent::take_from_video_decoder (shared_ptr<VideoDecoder> d) Changed (VideoContentProperty::VIDEO_SIZE); Changed (VideoContentProperty::VIDEO_FRAME_RATE); } + + +string +VideoContent::information () const +{ + stringstream s; + + s << String::compose ( + _("%1x%2 pixels (%3:1)"), + video_size().width, + video_size().height, + setprecision (3), float (video_size().width) / video_size().height + ); + + return s.str (); +} |
