Skip to content

Commit 895c2f0

Browse files
committed
FFmpegReader/Writer: Reformat example code
- Reduced crazy-long line lengths by moving trailing comments to previous line - Added more openshot:: prefixing, which causes Doxygen to link to the referenced object's documentation. (It doesn't always pick up cross-class links, without the prefix.)
1 parent 7867cf0 commit 895c2f0

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

include/FFmpegReader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ namespace openshot {
7676
*
7777
* @code
7878
* // Create a reader for a video
79-
* FFmpegReader r("MyAwesomeVideo.webm");
79+
* openshot::FFmpegReader r("MyAwesomeVideo.webm");
8080
* r.Open(); // Open the reader
8181
*
8282
* // Get frame number 1 from the video
83-
* std::shared_ptr<Frame> f = r.GetFrame(1);
83+
* std::shared_ptr<openshot::Frame> f = r.GetFrame(1);
8484
*
8585
* // Now that we have an openshot::Frame object, lets have some fun!
8686
* f->Display(); // Display the frame on the screen

include/FFmpegWriter.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,19 @@ namespace openshot {
7575
* @code SIMPLE EXAMPLE
7676
*
7777
* // Create a reader for a video
78-
* FFmpegReader r("MyAwesomeVideo.webm");
79-
* r.Open(); // Open thetarget_ reader
78+
* openshot::FFmpegReader r("MyAwesomeVideo.webm");
79+
* r.Open(); // Open the target reader
8080
*
8181
* // Create a writer (which will create a WebM video)
82-
* FFmpegWriter w("/home/jonathan/NewVideo.webm");
82+
* openshot::FFmpegWriter w("/home/jonathan/NewVideo.webm");
8383
*
8484
* // Set options
85-
* w.SetAudioOptions(true, "libvorbis", 44100, 2, ChannelLayout::LAYOUT_STEREO, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000
86-
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000); // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
85+
*
86+
* // Sample Rate: 44100, Channels: 2, Bitrate: 128000
87+
* w.SetAudioOptions(true, "libvorbis", 44100, 2, openshot::ChannelLayout::LAYOUT_STEREO, 128000);
88+
*
89+
* // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
90+
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000);
8791
*
8892
* // Open the writer
8993
* w.Open();
@@ -102,15 +106,19 @@ namespace openshot {
102106
* @code ADVANCED WRITER EXAMPLE
103107
*
104108
* // Create a reader for a video
105-
* FFmpegReader r("MyAwesomeVideo.webm");
109+
* openshot::FFmpegReader r("MyAwesomeVideo.webm");
106110
* r.Open(); // Open the reader
107111
*
108112
* // Create a writer (which will create a WebM video)
109-
* FFmpegWriter w("/home/jonathan/NewVideo.webm");
113+
* openshot::FFmpegWriter w("/home/jonathan/NewVideo.webm");
110114
*
111115
* // Set options
112-
* w.SetAudioOptions(true, "libvorbis", 44100, 2, ChannelLayout::LAYOUT_STEREO, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000
113-
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000); // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
116+
*
117+
* // Sample Rate: 44100, Channels: 2, Bitrate: 128000
118+
* w.SetAudioOptions(true, "libvorbis", 44100, 2, openshot::ChannelLayout::LAYOUT_STEREO, 128000);
119+
*
120+
* // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
121+
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000);
114122
*
115123
* // Prepare Streams (Optional method that must be called before any SetOption calls)
116124
* w.PrepareStreams();

0 commit comments

Comments
 (0)