std:: prefixes for ReaderBase

This commit is contained in:
FeRD (Frank Dana)
2019-08-04 22:41:51 -04:00
parent 5746cd7b8b
commit b64a100da2
2 changed files with 11 additions and 13 deletions

View File

@@ -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

View File

@@ -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();
}
}