Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: webrtc/api/androidvideocapturer.cc

Issue 1702603002: AndroidVideoCapturer getSupportedFormats(): Change interface from JSON string to List/vector (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove logging from C++. Remove json from api.gyp. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/androidvideocapturer.h ('k') | webrtc/api/api.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/androidvideocapturer.cc
diff --git a/webrtc/api/androidvideocapturer.cc b/webrtc/api/androidvideocapturer.cc
index 69278db3bd81cd1bc5118fbca74c2e29f143032b..a24d55c168e03f1fded01d02224babf7879508e6 100644
--- a/webrtc/api/androidvideocapturer.cc
+++ b/webrtc/api/androidvideocapturer.cc
@@ -12,7 +12,6 @@
#include "webrtc/api/java/jni/native_handle_impl.h"
#include "webrtc/base/common.h"
-#include "webrtc/base/json.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/media/engine/webrtcvideoframe.h"
@@ -119,29 +118,7 @@ AndroidVideoCapturer::AndroidVideoCapturer(
frame_factory_(NULL),
current_state_(cricket::CS_STOPPED) {
thread_checker_.DetachFromThread();
- std::string json_string = delegate_->GetSupportedFormats();
- LOG(LS_INFO) << json_string;
-
- Json::Value json_values;
- Json::Reader reader(Json::Features::strictMode());
- if (!reader.parse(json_string, json_values)) {
- LOG(LS_ERROR) << "Failed to parse formats.";
- }
-
- std::vector<cricket::VideoFormat> formats;
- for (Json::ArrayIndex i = 0; i < json_values.size(); ++i) {
- const Json::Value& json_value = json_values[i];
- RTC_CHECK(!json_value["width"].isNull() &&
- !json_value["height"].isNull() &&
- !json_value["framerate"].isNull());
- cricket::VideoFormat format(
- json_value["width"].asInt(),
- json_value["height"].asInt(),
- cricket::VideoFormat::FpsToInterval(json_value["framerate"].asInt()),
- cricket::FOURCC_YV12);
- formats.push_back(format);
- }
- SetSupportedFormats(formats);
+ SetSupportedFormats(delegate_->GetSupportedFormats());
}
AndroidVideoCapturer::~AndroidVideoCapturer() {
« no previous file with comments | « webrtc/api/androidvideocapturer.h ('k') | webrtc/api/api.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698