You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
std:: prefixes for ReaderBase
This commit is contained in:
@@ -49,8 +49,6 @@
|
||||
#include <QGraphicsPixmapItem>
|
||||
#include <QPixmap>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace openshot
|
||||
{
|
||||
/**
|
||||
@@ -74,20 +72,20 @@ namespace openshot
|
||||
int video_bit_rate; ///< The bit rate of the video stream (in bytes)
|
||||
Fraction pixel_ratio; ///< The pixel ratio of the video stream as a fraction (i.e. some pixels are not square)
|
||||
Fraction display_ratio; ///< The ratio of width to height of the video stream (i.e. 640x480 has a ratio of 4/3)
|
||||
string vcodec; ///< The name of the video codec used to encode / decode the video stream
|
||||
std::string vcodec; ///< The name of the video codec used to encode / decode the video stream
|
||||
int64_t video_length; ///< The number of frames in the video stream
|
||||
int video_stream_index; ///< The index of the video stream
|
||||
Fraction video_timebase; ///< The video timebase determines how long each frame stays on the screen
|
||||
bool interlaced_frame; // Are the contents of this frame interlaced
|
||||
bool top_field_first; // Which interlaced field should be displayed first
|
||||
string acodec; ///< The name of the audio codec used to encode / decode the video stream
|
||||
std::string acodec; ///< The name of the audio codec used to encode / decode the video stream
|
||||
int audio_bit_rate; ///< The bit rate of the audio stream (in bytes)
|
||||
int sample_rate; ///< The number of audio samples per second (44100 is a common sample rate)
|
||||
int channels; ///< The number of audio channels used in the audio stream
|
||||
ChannelLayout channel_layout; ///< The channel layout (mono, stereo, 5 point surround, etc...)
|
||||
int audio_stream_index; ///< The index of the audio stream
|
||||
Fraction audio_timebase; ///< The audio timebase determines how long each audio packet should be played
|
||||
std::map<string, string> metadata; ///< An optional map/dictionary of metadata for this reader
|
||||
std::map<std::string, std::string> metadata; ///< An optional map/dictionary of metadata for this reader
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -140,11 +138,11 @@ namespace openshot
|
||||
virtual bool IsOpen() = 0;
|
||||
|
||||
/// Return the type name of the class
|
||||
virtual string Name() = 0;
|
||||
virtual std::string Name() = 0;
|
||||
|
||||
/// Get and Set JSON methods
|
||||
virtual string Json() = 0; ///< Generate JSON string of this object
|
||||
virtual void SetJson(string value) = 0; ///< Load JSON string into this object
|
||||
virtual std::string Json() = 0; ///< Generate JSON string of this object
|
||||
virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object
|
||||
virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object
|
||||
virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ void ReaderBase::DisplayInfo() {
|
||||
cout << "----------------------------" << endl;
|
||||
|
||||
// Iterate through metadata
|
||||
map<string, string>::iterator it;
|
||||
std::map<std::string, std::string>::iterator it;
|
||||
for (it = info.metadata.begin(); it != info.metadata.end(); it++)
|
||||
cout << "--> " << it->first << ": " << it->second << endl;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ Json::Value ReaderBase::JsonValue() {
|
||||
root["has_audio"] = info.has_audio;
|
||||
root["has_single_image"] = info.has_single_image;
|
||||
root["duration"] = info.duration;
|
||||
stringstream filesize_stream;
|
||||
std::stringstream filesize_stream;
|
||||
filesize_stream << info.file_size;
|
||||
root["file_size"] = filesize_stream.str();
|
||||
root["height"] = info.height;
|
||||
@@ -139,7 +139,7 @@ Json::Value ReaderBase::JsonValue() {
|
||||
root["display_ratio"]["num"] = info.display_ratio.num;
|
||||
root["display_ratio"]["den"] = info.display_ratio.den;
|
||||
root["vcodec"] = info.vcodec;
|
||||
stringstream video_length_stream;
|
||||
std::stringstream video_length_stream;
|
||||
video_length_stream << info.video_length;
|
||||
root["video_length"] = video_length_stream.str();
|
||||
root["video_stream_index"] = info.video_stream_index;
|
||||
@@ -160,7 +160,7 @@ Json::Value ReaderBase::JsonValue() {
|
||||
|
||||
// Append metadata map
|
||||
root["metadata"] = Json::Value(Json::objectValue);
|
||||
map<string, string>::iterator it;
|
||||
std::map<std::string, std::string>::iterator it;
|
||||
for (it = info.metadata.begin(); it != info.metadata.end(); it++)
|
||||
root["metadata"][it->first] = it->second;
|
||||
|
||||
@@ -245,7 +245,7 @@ void ReaderBase::SetJsonValue(Json::Value root) {
|
||||
}
|
||||
if (!root["metadata"].isNull() && root["metadata"].isObject()) {
|
||||
for( Json::Value::iterator itr = root["metadata"].begin() ; itr != root["metadata"].end() ; itr++ ) {
|
||||
string key = itr.key().asString();
|
||||
std::string key = itr.key().asString();
|
||||
info.metadata[key] = root["metadata"][key].asString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user