Move talk/media to webrtc/media

I removed the 'libjingle' target in talk/libjingle.gyp and replaced
all users of it with base/base.gyp:rtc_base. It seems the jsoncpp
and expat dependencies were not used by it's previous references.

The files in talk/media/testdata were uploaded to Google Storage and
added .sha1 files in resources/media instead of simply moving them.

The previously disabled warnings that were inherited from
talk/build/common.gypi are now replaced by target-specific disabling
of only the failing warnings. Additional disabling was needed since the stricter
compilation warnings that applies to code in webrtc/.

License headers will be updated in a follow-up CL in order to not
break Git history.

Other modifications:
* Updated the header guards.
* Sorted the includes using chromium/src/tools/sort-headers.py
  except for these files:
  talk/app/webrtc/peerconnectionendtoend_unittest.cc
  talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
  talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
  webrtc/media/devices/win32devicemanager.cc.
* Unused GYP reference to libjingle_tests_additional_deps was removed.
* Removed duplicated GYP entries of
  webrtc/base/testutils.cc
  webrtc/base/testutils.h

The HAVE_WEBRTC_VIDEO and HAVE_WEBRTC_VOICE defines were used by only talk/media,
so they were moved to the media.gyp.

I also checked that none of
EXPAT_RELATIVE_PATH,
FEATURE_ENABLE_VOICEMAIL,
GTEST_RELATIVE_PATH,
JSONCPP_RELATIVE_PATH,
LOGGING=1,
SRTP_RELATIVE_PATH,
FEATURE_ENABLE_SSL,
FEATURE_ENABLE_VOICEMAIL,
FEATURE_ENABLE_PSTN,
HAVE_SCTP,
HAVE_SRTP,
are used by the talk/media code.

For Chromium, the following changes will need to be applied to the roll CL that updates the
DEPS for WebRTC and libjingle: https://codereview.chromium.org/1604303002/

BUG=webrtc:5420
NOPRESUBMIT=True
TBR=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1587193006

Cr-Commit-Position: refs/heads/master@{#11495}
diff --git a/.gitignore b/.gitignore
index 41d4d15..7bf3082 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,13 +50,16 @@
 /out
 /resources/**/*.aecdump
 /resources/**/*.bin
+/resources/**/*.byte
 /resources/**/*.chn
 /resources/**/*.dat
+/resources/**/*.frames
 /resources/**/*.gai
 /resources/**/*.jpg
 /resources/**/*.pcap
 /resources/**/*.pcm
 /resources/**/*.rtp
+/resources/**/*.rtpdump
 /resources/**/*.rx
 /resources/**/*.wav
 /resources/**/*.yuv
diff --git a/DEPS b/DEPS
index ad074f2..bb9ca02 100644
--- a/DEPS
+++ b/DEPS
@@ -42,6 +42,7 @@
   '+testing',
   '+third_party',
   '+unicode',
+  '+usrsctplib',
   '+webrtc',
   '+vpx',
 ]
diff --git a/resources/media/1.frame_plus_1.byte.sha1 b/resources/media/1.frame_plus_1.byte.sha1
new file mode 100644
index 0000000..25cfa97
--- /dev/null
+++ b/resources/media/1.frame_plus_1.byte.sha1
@@ -0,0 +1 @@
+8c398a382d0a36e733969230be593682c9a0dd75
\ No newline at end of file
diff --git a/resources/media/captured-320x240-2s-48.frames.sha1 b/resources/media/captured-320x240-2s-48.frames.sha1
new file mode 100644
index 0000000..18d4d90
--- /dev/null
+++ b/resources/media/captured-320x240-2s-48.frames.sha1
@@ -0,0 +1 @@
+bd6052a1dff9c55255034cbac5f98c0cb17be20b
\ No newline at end of file
diff --git a/resources/media/faces.1280x720_P420.yuv.sha1 b/resources/media/faces.1280x720_P420.yuv.sha1
new file mode 100644
index 0000000..32f1089
--- /dev/null
+++ b/resources/media/faces.1280x720_P420.yuv.sha1
@@ -0,0 +1 @@
+5ffdf950177ecd872e1f7f21c8d26936b950e09a
\ No newline at end of file
diff --git a/resources/media/faces_I400.jpg.sha1 b/resources/media/faces_I400.jpg.sha1
new file mode 100644
index 0000000..728287e
--- /dev/null
+++ b/resources/media/faces_I400.jpg.sha1
@@ -0,0 +1 @@
+3c7b95f86c7c219d959c04bbdf1db35b7faf8847
\ No newline at end of file
diff --git a/resources/media/faces_I411.jpg.sha1 b/resources/media/faces_I411.jpg.sha1
new file mode 100644
index 0000000..9626660
--- /dev/null
+++ b/resources/media/faces_I411.jpg.sha1
@@ -0,0 +1 @@
+4ab8170541a21fb7015496e84837a8f801077cfd
\ No newline at end of file
diff --git a/resources/media/faces_I420.jpg.sha1 b/resources/media/faces_I420.jpg.sha1
new file mode 100644
index 0000000..51c1150
--- /dev/null
+++ b/resources/media/faces_I420.jpg.sha1
@@ -0,0 +1 @@
+6e074b266e6c6ef0c3290aa3101487009f42b245
\ No newline at end of file
diff --git a/resources/media/faces_I422.jpg.sha1 b/resources/media/faces_I422.jpg.sha1
new file mode 100644
index 0000000..91682e2
--- /dev/null
+++ b/resources/media/faces_I422.jpg.sha1
@@ -0,0 +1 @@
+4d25abcbe6d2d71a29e52b5eab8a127a1f605359
\ No newline at end of file
diff --git a/resources/media/faces_I444.jpg.sha1 b/resources/media/faces_I444.jpg.sha1
new file mode 100644
index 0000000..520e338
--- /dev/null
+++ b/resources/media/faces_I444.jpg.sha1
@@ -0,0 +1 @@
+4e040d5332058d3435091ef441af7385198c2029
\ No newline at end of file
diff --git a/resources/media/h264-svc-99-640x360.rtpdump.sha1 b/resources/media/h264-svc-99-640x360.rtpdump.sha1
new file mode 100644
index 0000000..26b8775
--- /dev/null
+++ b/resources/media/h264-svc-99-640x360.rtpdump.sha1
@@ -0,0 +1 @@
+41ae53fcad7343b66c8351097a071bbb25e47ba4
\ No newline at end of file
diff --git a/resources/media/video.rtpdump.sha1 b/resources/media/video.rtpdump.sha1
new file mode 100644
index 0000000..e23c9f1
--- /dev/null
+++ b/resources/media/video.rtpdump.sha1
@@ -0,0 +1 @@
+714fa3ce8101fa7baa61842e3d8b37ebb2d602aa
\ No newline at end of file
diff --git a/resources/media/voice.rtpdump.sha1 b/resources/media/voice.rtpdump.sha1
new file mode 100644
index 0000000..2b53d40
--- /dev/null
+++ b/resources/media/voice.rtpdump.sha1
@@ -0,0 +1 @@
+bf76337737b1ed6d6815f6f3eeeee1e25dce55b6
\ No newline at end of file
diff --git a/talk/app/webrtc/androidvideocapturer.cc b/talk/app/webrtc/androidvideocapturer.cc
index d8f1217..6b0d51c 100644
--- a/talk/app/webrtc/androidvideocapturer.cc
+++ b/talk/app/webrtc/androidvideocapturer.cc
@@ -27,10 +27,10 @@
 #include "talk/app/webrtc/androidvideocapturer.h"
 
 #include "talk/app/webrtc/java/jni/native_handle_impl.h"
-#include "talk/media/webrtc/webrtcvideoframe.h"
 #include "webrtc/base/common.h"
 #include "webrtc/base/json.h"
 #include "webrtc/base/timeutils.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/androidvideocapturer.h b/talk/app/webrtc/androidvideocapturer.h
index c665eab..c6022f7 100644
--- a/talk/app/webrtc/androidvideocapturer.h
+++ b/talk/app/webrtc/androidvideocapturer.h
@@ -30,9 +30,9 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/videocapturer.h"
 #include "webrtc/base/thread_checker.h"
 #include "webrtc/common_video/include/video_frame_buffer.h"
+#include "webrtc/media/base/videocapturer.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/datachannel.cc b/talk/app/webrtc/datachannel.cc
index 20cf743..05fa5ec 100644
--- a/talk/app/webrtc/datachannel.cc
+++ b/talk/app/webrtc/datachannel.cc
@@ -31,9 +31,9 @@
 
 #include "talk/app/webrtc/mediastreamprovider.h"
 #include "talk/app/webrtc/sctputils.h"
-#include "talk/media/sctp/sctpdataengine.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/refcount.h"
+#include "webrtc/media/sctp/sctpdataengine.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/datachannel.h b/talk/app/webrtc/datachannel.h
index 2713ae3..00e0886 100644
--- a/talk/app/webrtc/datachannel.h
+++ b/talk/app/webrtc/datachannel.h
@@ -34,11 +34,11 @@
 
 #include "talk/app/webrtc/datachannelinterface.h"
 #include "talk/app/webrtc/proxy.h"
-#include "talk/media/base/mediachannel.h"
 #include "talk/session/media/channel.h"
 #include "webrtc/base/messagehandler.h"
 #include "webrtc/base/scoped_ref_ptr.h"
 #include "webrtc/base/sigslot.h"
+#include "webrtc/media/base/mediachannel.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/java/jni/androidmediacodeccommon.h b/talk/app/webrtc/java/jni/androidmediacodeccommon.h
index f007a8f..329aa2a 100644
--- a/talk/app/webrtc/java/jni/androidmediacodeccommon.h
+++ b/talk/app/webrtc/java/jni/androidmediacodeccommon.h
@@ -36,6 +36,7 @@
 #include "talk/app/webrtc/java/jni/jni_helpers.h"
 #include "webrtc/base/thread.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/base/thread.h"
 #include "webrtc/system_wrappers/include/tick_util.h"
 
 namespace webrtc_jni {
diff --git a/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc b/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
index 17f379d..be7393e 100644
--- a/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
+++ b/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
@@ -30,10 +30,15 @@
 #include <vector>
 
 #include "talk/app/webrtc/java/jni/androidmediadecoder_jni.h"
+// NOTICE: androidmediadecoder_jni.h must be included before
+// androidmediacodeccommon.h to avoid build errors.
 #include "talk/app/webrtc/java/jni/androidmediacodeccommon.h"
 #include "talk/app/webrtc/java/jni/classreferenceholder.h"
 #include "talk/app/webrtc/java/jni/native_handle_impl.h"
 #include "talk/app/webrtc/java/jni/surfacetexturehelper_jni.h"
+#include "third_party/libyuv/include/libyuv/convert.h"
+#include "third_party/libyuv/include/libyuv/convert_from.h"
+#include "third_party/libyuv/include/libyuv/video_common.h"
 #include "webrtc/base/bind.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/logging.h"
@@ -44,9 +49,6 @@
 #include "webrtc/modules/video_coding/include/video_codec_interface.h"
 #include "webrtc/system_wrappers/include/logcat_trace_context.h"
 #include "webrtc/system_wrappers/include/tick_util.h"
-#include "third_party/libyuv/include/libyuv/convert.h"
-#include "third_party/libyuv/include/libyuv/convert_from.h"
-#include "third_party/libyuv/include/libyuv/video_common.h"
 
 using rtc::Bind;
 using rtc::Thread;
diff --git a/talk/app/webrtc/java/jni/androidmediadecoder_jni.h b/talk/app/webrtc/java/jni/androidmediadecoder_jni.h
index 85a61c1..b25ec13 100644
--- a/talk/app/webrtc/java/jni/androidmediadecoder_jni.h
+++ b/talk/app/webrtc/java/jni/androidmediadecoder_jni.h
@@ -30,7 +30,7 @@
 #define TALK_APP_WEBRTC_JAVA_JNI_ANDROIDMEDIADECODER_JNI_H_
 
 #include "talk/app/webrtc/java/jni/eglbase_jni.h"
-#include "talk/media/webrtc/webrtcvideodecoderfactory.h"
+#include "webrtc/media/webrtc/webrtcvideodecoderfactory.h"
 
 namespace webrtc_jni {
 
diff --git a/talk/app/webrtc/java/jni/androidmediaencoder_jni.cc b/talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
index 8b5933f..aade95b 100644
--- a/talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
+++ b/talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
@@ -27,9 +27,14 @@
  */
 
 #include "talk/app/webrtc/java/jni/androidmediaencoder_jni.h"
-#include "talk/app/webrtc/java/jni/classreferenceholder.h"
+// NOTICE: androidmediaencoder_jni.h must be included before
+// androidmediacodeccommon.h to avoid build errors.
 #include "talk/app/webrtc/java/jni/androidmediacodeccommon.h"
+#include "talk/app/webrtc/java/jni/classreferenceholder.h"
 #include "talk/app/webrtc/java/jni/native_handle_impl.h"
+#include "third_party/libyuv/include/libyuv/convert.h"
+#include "third_party/libyuv/include/libyuv/convert_from.h"
+#include "third_party/libyuv/include/libyuv/video_common.h"
 #include "webrtc/base/bind.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/logging.h"
@@ -42,9 +47,6 @@
 #include "webrtc/modules/video_coding/utility/vp8_header_parser.h"
 #include "webrtc/system_wrappers/include/field_trial.h"
 #include "webrtc/system_wrappers/include/logcat_trace_context.h"
-#include "third_party/libyuv/include/libyuv/convert.h"
-#include "third_party/libyuv/include/libyuv/convert_from.h"
-#include "third_party/libyuv/include/libyuv/video_common.h"
 
 using rtc::Bind;
 using rtc::Thread;
diff --git a/talk/app/webrtc/java/jni/androidmediaencoder_jni.h b/talk/app/webrtc/java/jni/androidmediaencoder_jni.h
index 8b5f413..3d361d2 100644
--- a/talk/app/webrtc/java/jni/androidmediaencoder_jni.h
+++ b/talk/app/webrtc/java/jni/androidmediaencoder_jni.h
@@ -32,7 +32,7 @@
 #include <vector>
 
 #include "talk/app/webrtc/java/jni/eglbase_jni.h"
-#include "talk/media/webrtc/webrtcvideoencoderfactory.h"
+#include "webrtc/media/webrtc/webrtcvideoencoderfactory.h"
 
 namespace webrtc_jni {
 
diff --git a/talk/app/webrtc/java/jni/androidnetworkmonitor_jni.cc b/talk/app/webrtc/java/jni/androidnetworkmonitor_jni.cc
index 071ba45..69870dc 100644
--- a/talk/app/webrtc/java/jni/androidnetworkmonitor_jni.cc
+++ b/talk/app/webrtc/java/jni/androidnetworkmonitor_jni.cc
@@ -29,11 +29,11 @@
 
 #include <dlfcn.h>
 
+#include "talk/app/webrtc/java/jni/classreferenceholder.h"
+#include "talk/app/webrtc/java/jni/jni_helpers.h"
 #include "webrtc/base/bind.h"
 #include "webrtc/base/common.h"
 #include "webrtc/base/ipaddress.h"
-#include "talk/app/webrtc/java/jni/classreferenceholder.h"
-#include "talk/app/webrtc/java/jni/jni_helpers.h"
 
 namespace webrtc_jni {
 
diff --git a/talk/app/webrtc/java/jni/androidnetworkmonitor_jni.h b/talk/app/webrtc/java/jni/androidnetworkmonitor_jni.h
index a5c8490..39898ea 100644
--- a/talk/app/webrtc/java/jni/androidnetworkmonitor_jni.h
+++ b/talk/app/webrtc/java/jni/androidnetworkmonitor_jni.h
@@ -32,9 +32,9 @@
 
 #include <map>
 
+#include "talk/app/webrtc/java/jni/jni_helpers.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/thread_checker.h"
-#include "talk/app/webrtc/java/jni/jni_helpers.h"
 
 namespace webrtc_jni {
 
diff --git a/talk/app/webrtc/java/jni/classreferenceholder.h b/talk/app/webrtc/java/jni/classreferenceholder.h
index 46e018b..f345c1db 100644
--- a/talk/app/webrtc/java/jni/classreferenceholder.h
+++ b/talk/app/webrtc/java/jni/classreferenceholder.h
@@ -35,8 +35,8 @@
 #define TALK_APP_WEBRTC_JAVA_JNI_CLASSREFERENCEHOLDER_H_
 
 #include <jni.h>
-#include <string>
 #include <map>
+#include <string>
 
 namespace webrtc_jni {
 
diff --git a/talk/app/webrtc/java/jni/native_handle_impl.cc b/talk/app/webrtc/java/jni/native_handle_impl.cc
index 1757184..e253088 100644
--- a/talk/app/webrtc/java/jni/native_handle_impl.cc
+++ b/talk/app/webrtc/java/jni/native_handle_impl.cc
@@ -31,9 +31,9 @@
 #include "webrtc/base/bind.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/keep_ref_until_done.h"
+#include "webrtc/base/logging.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/scoped_ref_ptr.h"
-#include "webrtc/base/logging.h"
 
 using webrtc::NativeHandleBuffer;
 
diff --git a/talk/app/webrtc/java/jni/peerconnection_jni.cc b/talk/app/webrtc/java/jni/peerconnection_jni.cc
index 1e138f6..3237cd3 100644
--- a/talk/app/webrtc/java/jni/peerconnection_jni.cc
+++ b/talk/app/webrtc/java/jni/peerconnection_jni.cc
@@ -59,20 +59,15 @@
 #include <limits>
 #include <utility>
 
+#include "talk/app/webrtc/dtlsidentitystore.h"
 #include "talk/app/webrtc/java/jni/classreferenceholder.h"
 #include "talk/app/webrtc/java/jni/jni_helpers.h"
 #include "talk/app/webrtc/java/jni/native_handle_impl.h"
-#include "talk/app/webrtc/dtlsidentitystore.h"
 #include "talk/app/webrtc/mediaconstraintsinterface.h"
 #include "talk/app/webrtc/peerconnectioninterface.h"
 #include "talk/app/webrtc/rtpreceiverinterface.h"
 #include "talk/app/webrtc/rtpsenderinterface.h"
 #include "talk/app/webrtc/videosourceinterface.h"
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videorenderer.h"
-#include "talk/media/devices/videorendererfactory.h"
-#include "talk/media/webrtc/webrtcvideodecoderfactory.h"
-#include "talk/media/webrtc/webrtcvideoencoderfactory.h"
 #include "webrtc/base/bind.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/event_tracer.h"
@@ -82,6 +77,11 @@
 #include "webrtc/base/networkmonitor.h"
 #include "webrtc/base/ssladapter.h"
 #include "webrtc/base/stringutils.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videorenderer.h"
+#include "webrtc/media/devices/videorendererfactory.h"
+#include "webrtc/media/webrtc/webrtcvideodecoderfactory.h"
+#include "webrtc/media/webrtc/webrtcvideoencoderfactory.h"
 #include "webrtc/system_wrappers/include/field_trial_default.h"
 #include "webrtc/system_wrappers/include/trace.h"
 #include "webrtc/voice_engine/include/voe_base.h"
@@ -90,8 +90,8 @@
 #include "talk/app/webrtc/androidvideocapturer.h"
 #include "talk/app/webrtc/java/jni/androidmediadecoder_jni.h"
 #include "talk/app/webrtc/java/jni/androidmediaencoder_jni.h"
-#include "talk/app/webrtc/java/jni/androidvideocapturer_jni.h"
 #include "talk/app/webrtc/java/jni/androidnetworkmonitor_jni.h"
+#include "talk/app/webrtc/java/jni/androidvideocapturer_jni.h"
 #include "webrtc/modules/video_render/video_render_internal.h"
 #include "webrtc/system_wrappers/include/logcat_trace_context.h"
 using webrtc::LogcatTraceContext;
diff --git a/talk/app/webrtc/jsepicecandidate.h b/talk/app/webrtc/jsepicecandidate.h
index 1d5ef19..539376e 100644
--- a/talk/app/webrtc/jsepicecandidate.h
+++ b/talk/app/webrtc/jsepicecandidate.h
@@ -33,8 +33,8 @@
 #include <string>
 
 #include "talk/app/webrtc/jsep.h"
-#include "webrtc/p2p/base/candidate.h"
 #include "webrtc/base/constructormagic.h"
+#include "webrtc/p2p/base/candidate.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/jsepsessiondescription_unittest.cc b/talk/app/webrtc/jsepsessiondescription_unittest.cc
index d00617b..dc0773a 100644
--- a/talk/app/webrtc/jsepsessiondescription_unittest.cc
+++ b/talk/app/webrtc/jsepsessiondescription_unittest.cc
@@ -29,15 +29,15 @@
 
 #include "talk/app/webrtc/jsepicecandidate.h"
 #include "talk/app/webrtc/jsepsessiondescription.h"
-#include "webrtc/p2p/base/candidate.h"
-#include "webrtc/p2p/base/constants.h"
-#include "webrtc/p2p/base/sessiondescription.h"
 #include "talk/session/media/mediasession.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/helpers.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/ssladapter.h"
 #include "webrtc/base/stringencode.h"
+#include "webrtc/p2p/base/candidate.h"
+#include "webrtc/p2p/base/constants.h"
+#include "webrtc/p2p/base/sessiondescription.h"
 
 using webrtc::IceCandidateCollection;
 using webrtc::IceCandidateInterface;
diff --git a/talk/app/webrtc/localaudiosource.cc b/talk/app/webrtc/localaudiosource.cc
index 591877a..9789fe6 100644
--- a/talk/app/webrtc/localaudiosource.cc
+++ b/talk/app/webrtc/localaudiosource.cc
@@ -30,7 +30,7 @@
 #include <vector>
 
 #include "talk/app/webrtc/mediaconstraintsinterface.h"
-#include "talk/media/base/mediaengine.h"
+#include "webrtc/media/base/mediaengine.h"
 
 using webrtc::MediaConstraintsInterface;
 using webrtc::MediaSourceInterface;
diff --git a/talk/app/webrtc/localaudiosource.h b/talk/app/webrtc/localaudiosource.h
index 5158eb1..67750aa 100644
--- a/talk/app/webrtc/localaudiosource.h
+++ b/talk/app/webrtc/localaudiosource.h
@@ -31,8 +31,8 @@
 #include "talk/app/webrtc/mediastreaminterface.h"
 #include "talk/app/webrtc/notifier.h"
 #include "talk/app/webrtc/peerconnectioninterface.h"
-#include "talk/media/base/mediachannel.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/mediachannel.h"
 
 // LocalAudioSource implements AudioSourceInterface.
 // This contains settings for switching audio processing on and off.
diff --git a/talk/app/webrtc/localaudiosource_unittest.cc b/talk/app/webrtc/localaudiosource_unittest.cc
index 75d0c35..5ff1a7a 100644
--- a/talk/app/webrtc/localaudiosource_unittest.cc
+++ b/talk/app/webrtc/localaudiosource_unittest.cc
@@ -31,9 +31,9 @@
 #include <vector>
 
 #include "talk/app/webrtc/test/fakeconstraints.h"
-#include "talk/media/base/fakemediaengine.h"
-#include "talk/media/base/fakevideorenderer.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/base/fakemediaengine.h"
+#include "webrtc/media/base/fakevideorenderer.h"
 
 using webrtc::LocalAudioSource;
 using webrtc::MediaConstraintsInterface;
diff --git a/talk/app/webrtc/objc/RTCI420Frame+Internal.h b/talk/app/webrtc/objc/RTCI420Frame+Internal.h
index b38df20..b910ae3 100644
--- a/talk/app/webrtc/objc/RTCI420Frame+Internal.h
+++ b/talk/app/webrtc/objc/RTCI420Frame+Internal.h
@@ -27,7 +27,7 @@
 
 #import "RTCI420Frame.h"
 
-#include "talk/media/base/videoframe.h"
+#include "webrtc/media/base/videoframe.h"
 
 @interface RTCI420Frame (Internal)
 
diff --git a/talk/app/webrtc/objc/RTCI420Frame.mm b/talk/app/webrtc/objc/RTCI420Frame.mm
index c1a9cc0..0ce24a3 100644
--- a/talk/app/webrtc/objc/RTCI420Frame.mm
+++ b/talk/app/webrtc/objc/RTCI420Frame.mm
@@ -27,7 +27,7 @@
 
 #import "RTCI420Frame.h"
 
-#include "talk/media/base/videoframe.h"
+#include "webrtc/media/base/videoframe.h"
 #include "webrtc/base/scoped_ptr.h"
 
 @implementation RTCI420Frame {
diff --git a/talk/app/webrtc/objc/RTCVideoCapturer.mm b/talk/app/webrtc/objc/RTCVideoCapturer.mm
index 11973ee..2ce01f5 100644
--- a/talk/app/webrtc/objc/RTCVideoCapturer.mm
+++ b/talk/app/webrtc/objc/RTCVideoCapturer.mm
@@ -31,8 +31,8 @@
 
 #import "RTCVideoCapturer+Internal.h"
 
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/devices/devicemanager.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 @implementation RTCVideoCapturer {
   rtc::scoped_ptr<cricket::VideoCapturer> _capturer;
diff --git a/talk/app/webrtc/objc/avfoundationvideocapturer.h b/talk/app/webrtc/objc/avfoundationvideocapturer.h
index 32de09a..b496f69 100644
--- a/talk/app/webrtc/objc/avfoundationvideocapturer.h
+++ b/talk/app/webrtc/objc/avfoundationvideocapturer.h
@@ -28,8 +28,8 @@
 #ifndef TALK_APP_WEBRTC_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_
 #define TALK_APP_WEBRTC_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_
 
-#include "talk/media/base/videocapturer.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/videocapturer.h"
 #include "webrtc/video_frame.h"
 
 #import <AVFoundation/AVFoundation.h>
diff --git a/talk/app/webrtc/peerconnection.cc b/talk/app/webrtc/peerconnection.cc
index beae770..c375e29 100644
--- a/talk/app/webrtc/peerconnection.cc
+++ b/talk/app/webrtc/peerconnection.cc
@@ -48,13 +48,13 @@
 #include "talk/app/webrtc/streamcollection.h"
 #include "talk/app/webrtc/videosource.h"
 #include "talk/app/webrtc/videotrack.h"
-#include "talk/media/sctp/sctpdataengine.h"
 #include "talk/session/media/channelmanager.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/stringencode.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/base/trace_event.h"
+#include "webrtc/media/sctp/sctpdataengine.h"
 #include "webrtc/p2p/client/basicportallocator.h"
 #include "webrtc/system_wrappers/include/field_trial.h"
 
diff --git a/talk/app/webrtc/peerconnection_unittest.cc b/talk/app/webrtc/peerconnection_unittest.cc
index cf53c44..9061591 100644
--- a/talk/app/webrtc/peerconnection_unittest.cc
+++ b/talk/app/webrtc/peerconnection_unittest.cc
@@ -47,7 +47,6 @@
 #include "talk/app/webrtc/test/fakevideotrackrenderer.h"
 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h"
 #include "talk/app/webrtc/videosourceinterface.h"
-#include "talk/media/webrtc/fakewebrtcvideoengine.h"
 #include "talk/session/media/mediasession.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/physicalsocketserver.h"
@@ -56,6 +55,7 @@
 #include "webrtc/base/sslstreamadapter.h"
 #include "webrtc/base/thread.h"
 #include "webrtc/base/virtualsocketserver.h"
+#include "webrtc/media/webrtc/fakewebrtcvideoengine.h"
 #include "webrtc/p2p/base/constants.h"
 #include "webrtc/p2p/base/sessiondescription.h"
 #include "webrtc/p2p/client/fakeportallocator.h"
diff --git a/talk/app/webrtc/peerconnectionendtoend_unittest.cc b/talk/app/webrtc/peerconnectionendtoend_unittest.cc
index 1a18031..f71ce61 100644
--- a/talk/app/webrtc/peerconnectionendtoend_unittest.cc
+++ b/talk/app/webrtc/peerconnectionendtoend_unittest.cc
@@ -26,6 +26,7 @@
  */
 
 #include "talk/app/webrtc/test/peerconnectiontestwrapper.h"
+// Notice that mockpeerconnectionobservers.h must be included after the above!
 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h"
 #ifdef WEBRTC_ANDROID
 #include "talk/app/webrtc/test/androidtestinitializer.h"
diff --git a/talk/app/webrtc/peerconnectionfactory.cc b/talk/app/webrtc/peerconnectionfactory.cc
index ab8fdf5..a781eb3 100644
--- a/talk/app/webrtc/peerconnectionfactory.cc
+++ b/talk/app/webrtc/peerconnectionfactory.cc
@@ -40,10 +40,10 @@
 #include "talk/app/webrtc/videosource.h"
 #include "talk/app/webrtc/videosourceproxy.h"
 #include "talk/app/webrtc/videotrack.h"
-#include "talk/media/webrtc/webrtcmediaengine.h"
-#include "talk/media/webrtc/webrtcvideodecoderfactory.h"
-#include "talk/media/webrtc/webrtcvideoencoderfactory.h"
 #include "webrtc/base/bind.h"
+#include "webrtc/media/webrtc/webrtcmediaengine.h"
+#include "webrtc/media/webrtc/webrtcvideodecoderfactory.h"
+#include "webrtc/media/webrtc/webrtcvideoencoderfactory.h"
 #include "webrtc/modules/audio_device/include/audio_device.h"
 #include "webrtc/p2p/base/basicpacketsocketfactory.h"
 #include "webrtc/p2p/client/basicportallocator.h"
diff --git a/talk/app/webrtc/peerconnectionfactory_unittest.cc b/talk/app/webrtc/peerconnectionfactory_unittest.cc
index 1fdf2eb..d0d2f00 100644
--- a/talk/app/webrtc/peerconnectionfactory_unittest.cc
+++ b/talk/app/webrtc/peerconnectionfactory_unittest.cc
@@ -36,12 +36,12 @@
 #include "talk/app/webrtc/test/fakedtlsidentitystore.h"
 #include "talk/app/webrtc/test/fakevideotrackrenderer.h"
 #include "talk/app/webrtc/videosourceinterface.h"
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/webrtc/webrtccommon.h"
-#include "talk/media/webrtc/webrtcvoe.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/webrtc/webrtccommon.h"
+#include "webrtc/media/webrtc/webrtcvoe.h"
 #include "webrtc/p2p/client/fakeportallocator.h"
 
 using webrtc::DataChannelInterface;
diff --git a/talk/app/webrtc/peerconnectioninterface.h b/talk/app/webrtc/peerconnectioninterface.h
index e449dc4..9c0cefa 100644
--- a/talk/app/webrtc/peerconnectioninterface.h
+++ b/talk/app/webrtc/peerconnectioninterface.h
@@ -74,8 +74,8 @@
 
 #include "talk/app/webrtc/datachannelinterface.h"
 #include "talk/app/webrtc/dtlsidentitystore.h"
-#include "talk/app/webrtc/dtmfsenderinterface.h"
 #include "talk/app/webrtc/dtlsidentitystore.h"
+#include "talk/app/webrtc/dtmfsenderinterface.h"
 #include "talk/app/webrtc/jsep.h"
 #include "talk/app/webrtc/mediastreaminterface.h"
 #include "talk/app/webrtc/rtpreceiverinterface.h"
@@ -85,8 +85,8 @@
 #include "webrtc/base/fileutils.h"
 #include "webrtc/base/network.h"
 #include "webrtc/base/rtccertificate.h"
-#include "webrtc/base/sslstreamadapter.h"
 #include "webrtc/base/socketaddress.h"
+#include "webrtc/base/sslstreamadapter.h"
 #include "webrtc/p2p/base/portallocator.h"
 
 namespace rtc {
diff --git a/talk/app/webrtc/peerconnectioninterface_unittest.cc b/talk/app/webrtc/peerconnectioninterface_unittest.cc
index 421836e..2388e71 100644
--- a/talk/app/webrtc/peerconnectioninterface_unittest.cc
+++ b/talk/app/webrtc/peerconnectioninterface_unittest.cc
@@ -46,8 +46,6 @@
 #include "talk/app/webrtc/test/testsdpstrings.h"
 #include "talk/app/webrtc/videosource.h"
 #include "talk/app/webrtc/videotrack.h"
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/sctp/sctpdataengine.h"
 #include "talk/session/media/mediasession.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/scoped_ptr.h"
@@ -55,6 +53,8 @@
 #include "webrtc/base/sslstreamadapter.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/sctp/sctpdataengine.h"
 #include "webrtc/p2p/client/fakeportallocator.h"
 
 static const char kStreamLabel1[] = "local_stream_1";
diff --git a/talk/app/webrtc/remoteaudiosource.h b/talk/app/webrtc/remoteaudiosource.h
index d648ba4..0e28157 100644
--- a/talk/app/webrtc/remoteaudiosource.h
+++ b/talk/app/webrtc/remoteaudiosource.h
@@ -33,9 +33,9 @@
 
 #include "talk/app/webrtc/mediastreaminterface.h"
 #include "talk/app/webrtc/notifier.h"
-#include "talk/media/base/audiorenderer.h"
 #include "webrtc/audio/audio_sink.h"
 #include "webrtc/base/criticalsection.h"
+#include "webrtc/media/base/audiorenderer.h"
 
 namespace rtc {
 struct Message;
diff --git a/talk/app/webrtc/remotevideocapturer.cc b/talk/app/webrtc/remotevideocapturer.cc
index b0c9f9f..7e69eed 100644
--- a/talk/app/webrtc/remotevideocapturer.cc
+++ b/talk/app/webrtc/remotevideocapturer.cc
@@ -27,8 +27,8 @@
 
 #include "talk/app/webrtc/remotevideocapturer.h"
 
-#include "talk/media/base/videoframe.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/base/videoframe.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/remotevideocapturer.h b/talk/app/webrtc/remotevideocapturer.h
index b5298d9..02f48b7 100644
--- a/talk/app/webrtc/remotevideocapturer.h
+++ b/talk/app/webrtc/remotevideocapturer.h
@@ -31,8 +31,8 @@
 #include <vector>
 
 #include "talk/app/webrtc/mediastreaminterface.h"
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videorenderer.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videorenderer.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/remotevideocapturer_unittest.cc b/talk/app/webrtc/remotevideocapturer_unittest.cc
index 88277b6..8e79325 100644
--- a/talk/app/webrtc/remotevideocapturer_unittest.cc
+++ b/talk/app/webrtc/remotevideocapturer_unittest.cc
@@ -28,8 +28,8 @@
 #include <string>
 
 #include "talk/app/webrtc/remotevideocapturer.h"
-#include "talk/media/webrtc/webrtcvideoframe.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
 
 using cricket::CaptureState;
 using cricket::VideoCapturer;
diff --git a/talk/app/webrtc/rtpreceiverinterface.h b/talk/app/webrtc/rtpreceiverinterface.h
index 099699e..120a50f 100644
--- a/talk/app/webrtc/rtpreceiverinterface.h
+++ b/talk/app/webrtc/rtpreceiverinterface.h
@@ -33,8 +33,8 @@
 
 #include <string>
 
-#include "talk/app/webrtc/proxy.h"
 #include "talk/app/webrtc/mediastreaminterface.h"
+#include "talk/app/webrtc/proxy.h"
 #include "webrtc/base/refcount.h"
 #include "webrtc/base/scoped_ref_ptr.h"
 
diff --git a/talk/app/webrtc/rtpsender.h b/talk/app/webrtc/rtpsender.h
index 9e055c1..c68f64b 100644
--- a/talk/app/webrtc/rtpsender.h
+++ b/talk/app/webrtc/rtpsender.h
@@ -37,10 +37,10 @@
 #include "talk/app/webrtc/mediastreamprovider.h"
 #include "talk/app/webrtc/rtpsenderinterface.h"
 #include "talk/app/webrtc/statscollector.h"
-#include "talk/media/base/audiorenderer.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/audiorenderer.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/rtpsenderinterface.h b/talk/app/webrtc/rtpsenderinterface.h
index f54e8ca..f96ff1e 100644
--- a/talk/app/webrtc/rtpsenderinterface.h
+++ b/talk/app/webrtc/rtpsenderinterface.h
@@ -33,8 +33,8 @@
 
 #include <string>
 
-#include "talk/app/webrtc/proxy.h"
 #include "talk/app/webrtc/mediastreaminterface.h"
+#include "talk/app/webrtc/proxy.h"
 #include "talk/session/media/mediasession.h"
 #include "webrtc/base/refcount.h"
 #include "webrtc/base/scoped_ref_ptr.h"
diff --git a/talk/app/webrtc/rtpsenderreceiver_unittest.cc b/talk/app/webrtc/rtpsenderreceiver_unittest.cc
index 5018ccf..b9ef881 100644
--- a/talk/app/webrtc/rtpsenderreceiver_unittest.cc
+++ b/talk/app/webrtc/rtpsenderreceiver_unittest.cc
@@ -36,11 +36,11 @@
 #include "talk/app/webrtc/streamcollection.h"
 #include "talk/app/webrtc/videosource.h"
 #include "talk/app/webrtc/videotrack.h"
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/mediachannel.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/mediachannel.h"
 
 using ::testing::_;
 using ::testing::Exactly;
diff --git a/talk/app/webrtc/statscollector_unittest.cc b/talk/app/webrtc/statscollector_unittest.cc
index b22a8fb..1b16b0c 100644
--- a/talk/app/webrtc/statscollector_unittest.cc
+++ b/talk/app/webrtc/statscollector_unittest.cc
@@ -31,14 +31,13 @@
 
 #include "talk/app/webrtc/statscollector.h"
 
-#include "talk/app/webrtc/peerconnection.h"
-#include "talk/app/webrtc/peerconnectionfactory.h"
 #include "talk/app/webrtc/mediastream.h"
 #include "talk/app/webrtc/mediastreaminterface.h"
 #include "talk/app/webrtc/mediastreamtrack.h"
+#include "talk/app/webrtc/peerconnection.h"
+#include "talk/app/webrtc/peerconnectionfactory.h"
 #include "talk/app/webrtc/test/fakedatachannelprovider.h"
 #include "talk/app/webrtc/videotrack.h"
-#include "talk/media/base/fakemediaengine.h"
 #include "talk/session/media/channelmanager.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -46,6 +45,7 @@
 #include "webrtc/base/fakesslidentity.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/network.h"
+#include "webrtc/media/base/fakemediaengine.h"
 #include "webrtc/p2p/base/faketransportcontroller.h"
 
 using rtc::scoped_ptr;
diff --git a/talk/app/webrtc/statstypes.h b/talk/app/webrtc/statstypes.h
index ff447a5..6f547e1 100644
--- a/talk/app/webrtc/statstypes.h
+++ b/talk/app/webrtc/statstypes.h
@@ -38,9 +38,9 @@
 
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/common.h"
+#include "webrtc/base/linked_ptr.h"
 #include "webrtc/base/refcount.h"
 #include "webrtc/base/scoped_ptr.h"
-#include "webrtc/base/linked_ptr.h"
 #include "webrtc/base/scoped_ref_ptr.h"
 #include "webrtc/base/stringencode.h"
 #include "webrtc/base/thread_checker.h"
diff --git a/talk/app/webrtc/test/fakeperiodicvideocapturer.h b/talk/app/webrtc/test/fakeperiodicvideocapturer.h
index 34e4278..7e6863c 100644
--- a/talk/app/webrtc/test/fakeperiodicvideocapturer.h
+++ b/talk/app/webrtc/test/fakeperiodicvideocapturer.h
@@ -31,8 +31,8 @@
 #ifndef TALK_APP_WEBRTC_TEST_FAKEPERIODICVIDEOCAPTURER_H_
 #define TALK_APP_WEBRTC_TEST_FAKEPERIODICVIDEOCAPTURER_H_
 
-#include "talk/media/base/fakevideocapturer.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/fakevideocapturer.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/test/fakevideotrackrenderer.h b/talk/app/webrtc/test/fakevideotrackrenderer.h
index 100054a..97e7eea 100644
--- a/talk/app/webrtc/test/fakevideotrackrenderer.h
+++ b/talk/app/webrtc/test/fakevideotrackrenderer.h
@@ -29,7 +29,7 @@
 #define TALK_APP_WEBRTC_TEST_FAKEVIDEOTRACKRENDERER_H_
 
 #include "talk/app/webrtc/mediastreaminterface.h"
-#include "talk/media/base/fakevideorenderer.h"
+#include "webrtc/media/base/fakevideorenderer.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/videosource.cc b/talk/app/webrtc/videosource.cc
index 8006c58..018bad7 100644
--- a/talk/app/webrtc/videosource.cc
+++ b/talk/app/webrtc/videosource.cc
@@ -27,8 +27,8 @@
 
 #include "talk/app/webrtc/videosource.h"
 
-#include <vector>
 #include <cstdlib>
+#include <vector>
 
 #include "talk/app/webrtc/mediaconstraintsinterface.h"
 #include "talk/session/media/channelmanager.h"
diff --git a/talk/app/webrtc/videosource.h b/talk/app/webrtc/videosource.h
index eaaec41..24a9f99 100644
--- a/talk/app/webrtc/videosource.h
+++ b/talk/app/webrtc/videosource.h
@@ -34,11 +34,11 @@
 #include "talk/app/webrtc/notifier.h"
 #include "talk/app/webrtc/videosourceinterface.h"
 #include "talk/app/webrtc/videotrackrenderers.h"
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videocommon.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/media/base/videosinkinterface.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videocommon.h"
 
 // VideoSource implements VideoSourceInterface. It owns a
 // cricket::VideoCapturer and make sure the camera is started at a resolution
diff --git a/talk/app/webrtc/videosource_unittest.cc b/talk/app/webrtc/videosource_unittest.cc
index a2aaeba..7d8a731 100644
--- a/talk/app/webrtc/videosource_unittest.cc
+++ b/talk/app/webrtc/videosource_unittest.cc
@@ -31,12 +31,12 @@
 #include "talk/app/webrtc/remotevideocapturer.h"
 #include "talk/app/webrtc/test/fakeconstraints.h"
 #include "talk/app/webrtc/videosource.h"
-#include "talk/media/base/fakemediaengine.h"
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/fakevideorenderer.h"
-#include "talk/media/webrtc/webrtcvideoframe.h"
 #include "talk/session/media/channelmanager.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/base/fakemediaengine.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/fakevideorenderer.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
 
 using webrtc::FakeConstraints;
 using webrtc::VideoSource;
diff --git a/talk/app/webrtc/videosourceinterface.h b/talk/app/webrtc/videosourceinterface.h
index 7ce0de8..6ae45cb 100644
--- a/talk/app/webrtc/videosourceinterface.h
+++ b/talk/app/webrtc/videosourceinterface.h
@@ -29,8 +29,8 @@
 #define TALK_APP_WEBRTC_VIDEOSOURCEINTERFACE_H_
 
 #include "talk/app/webrtc/mediastreaminterface.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/videorenderer.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/videorenderer.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/videotrack_unittest.cc b/talk/app/webrtc/videotrack_unittest.cc
index 491c45b..a205a28 100644
--- a/talk/app/webrtc/videotrack_unittest.cc
+++ b/talk/app/webrtc/videotrack_unittest.cc
@@ -31,11 +31,11 @@
 #include "talk/app/webrtc/test/fakevideotrackrenderer.h"
 #include "talk/app/webrtc/videosource.h"
 #include "talk/app/webrtc/videotrack.h"
-#include "talk/media/base/fakemediaengine.h"
-#include "talk/media/webrtc/webrtcvideoframe.h"
 #include "talk/session/media/channelmanager.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/fakemediaengine.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
 
 using webrtc::FakeVideoTrackRenderer;
 using webrtc::VideoSource;
diff --git a/talk/app/webrtc/videotrackrenderers.cc b/talk/app/webrtc/videotrackrenderers.cc
index 5b89037..81f6530 100644
--- a/talk/app/webrtc/videotrackrenderers.cc
+++ b/talk/app/webrtc/videotrackrenderers.cc
@@ -26,7 +26,7 @@
  */
 
 #include "talk/app/webrtc/videotrackrenderers.h"
-#include "talk/media/webrtc/webrtcvideoframe.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/videotrackrenderers.h b/talk/app/webrtc/videotrackrenderers.h
index 2a73ed4..f66f8db 100644
--- a/talk/app/webrtc/videotrackrenderers.h
+++ b/talk/app/webrtc/videotrackrenderers.h
@@ -31,9 +31,9 @@
 #include <set>
 
 #include "talk/app/webrtc/mediastreaminterface.h"
-#include "talk/media/base/videorenderer.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/videorenderer.h"
 
 namespace webrtc {
 
diff --git a/talk/app/webrtc/webrtcsdp.cc b/talk/app/webrtc/webrtcsdp.cc
index f5fb7f7..16c0e69 100644
--- a/talk/app/webrtc/webrtcsdp.cc
+++ b/talk/app/webrtc/webrtcsdp.cc
@@ -27,29 +27,29 @@
 
 #include "talk/app/webrtc/webrtcsdp.h"
 
+#include <ctype.h>
 #include <limits.h>
 #include <stdio.h>
 #include <algorithm>
 #include <string>
 #include <vector>
-#include <ctype.h>
 
 #include "talk/app/webrtc/jsepicecandidate.h"
 #include "talk/app/webrtc/jsepsessiondescription.h"
-#include "talk/media/base/codec.h"
-#include "talk/media/base/constants.h"
-#include "talk/media/base/cryptoparams.h"
-#include "talk/media/base/rtputils.h"
-#include "talk/media/sctp/sctpdataengine.h"
-#include "webrtc/p2p/base/candidate.h"
-#include "webrtc/p2p/base/constants.h"
-#include "webrtc/p2p/base/port.h"
 #include "talk/session/media/mediasession.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/common.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/messagedigest.h"
 #include "webrtc/base/stringutils.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/cryptoparams.h"
+#include "webrtc/media/base/rtputils.h"
+#include "webrtc/media/sctp/sctpdataengine.h"
+#include "webrtc/p2p/base/candidate.h"
+#include "webrtc/p2p/base/constants.h"
+#include "webrtc/p2p/base/port.h"
 
 using cricket::AudioContentDescription;
 using cricket::Candidate;
diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc
index 70e0f36..3e438ff 100644
--- a/talk/app/webrtc/webrtcsdp_unittest.cc
+++ b/talk/app/webrtc/webrtcsdp_unittest.cc
@@ -34,8 +34,6 @@
 #include "talk/app/webrtc/test/androidtestinitializer.h"
 #endif
 #include "talk/app/webrtc/webrtcsdp.h"
-#include "talk/media/base/constants.h"
-#include "webrtc/p2p/base/constants.h"
 #include "talk/session/media/mediasession.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/logging.h"
@@ -44,6 +42,8 @@
 #include "webrtc/base/sslfingerprint.h"
 #include "webrtc/base/stringencode.h"
 #include "webrtc/base/stringutils.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/p2p/base/constants.h"
 
 using cricket::AudioCodec;
 using cricket::AudioContentDescription;
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc
index 7dd2a81..5957cae 100644
--- a/talk/app/webrtc/webrtcsession.cc
+++ b/talk/app/webrtc/webrtcsession.cc
@@ -40,8 +40,6 @@
 #include "talk/app/webrtc/peerconnectioninterface.h"
 #include "talk/app/webrtc/sctputils.h"
 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h"
-#include "talk/media/base/constants.h"
-#include "talk/media/base/videocapturer.h"
 #include "talk/session/media/channel.h"
 #include "talk/session/media/channelmanager.h"
 #include "talk/session/media/mediasession.h"
@@ -53,6 +51,8 @@
 #include "webrtc/base/stringencode.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/call.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/videocapturer.h"
 #include "webrtc/p2p/base/portallocator.h"
 #include "webrtc/p2p/base/transportchannel.h"
 
diff --git a/talk/app/webrtc/webrtcsession.h b/talk/app/webrtc/webrtcsession.h
index 16af74a..9695de6 100644
--- a/talk/app/webrtc/webrtcsession.h
+++ b/talk/app/webrtc/webrtcsession.h
@@ -37,11 +37,11 @@
 #include "talk/app/webrtc/mediastreamprovider.h"
 #include "talk/app/webrtc/peerconnectioninterface.h"
 #include "talk/app/webrtc/statstypes.h"
-#include "talk/media/base/mediachannel.h"
 #include "talk/session/media/mediasession.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/sslidentity.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/mediachannel.h"
 #include "webrtc/p2p/base/transportcontroller.h"
 
 namespace cricket {
diff --git a/talk/app/webrtc/webrtcsession_unittest.cc b/talk/app/webrtc/webrtcsession_unittest.cc
index 52a3f0a..c553165 100644
--- a/talk/app/webrtc/webrtcsession_unittest.cc
+++ b/talk/app/webrtc/webrtcsession_unittest.cc
@@ -42,15 +42,6 @@
 #include "talk/app/webrtc/videotrack.h"
 #include "talk/app/webrtc/webrtcsession.h"
 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h"
-#include "talk/media/base/fakemediaengine.h"
-#include "talk/media/base/fakevideorenderer.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/webrtc/fakewebrtccall.h"
-#include "webrtc/p2p/base/stunserver.h"
-#include "webrtc/p2p/base/teststunserver.h"
-#include "webrtc/p2p/base/testturnserver.h"
-#include "webrtc/p2p/base/transportchannel.h"
-#include "webrtc/p2p/client/basicportallocator.h"
 #include "talk/session/media/channelmanager.h"
 #include "talk/session/media/mediasession.h"
 #include "webrtc/base/fakenetwork.h"
@@ -65,6 +56,15 @@
 #include "webrtc/base/stringutils.h"
 #include "webrtc/base/thread.h"
 #include "webrtc/base/virtualsocketserver.h"
+#include "webrtc/media/base/fakemediaengine.h"
+#include "webrtc/media/base/fakevideorenderer.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/webrtc/fakewebrtccall.h"
+#include "webrtc/p2p/base/stunserver.h"
+#include "webrtc/p2p/base/teststunserver.h"
+#include "webrtc/p2p/base/testturnserver.h"
+#include "webrtc/p2p/base/transportchannel.h"
+#include "webrtc/p2p/client/basicportallocator.h"
 
 #define MAYBE_SKIP_TEST(feature)                    \
   if (!(feature())) {                               \
diff --git a/talk/app/webrtc/webrtcsessiondescriptionfactory.h b/talk/app/webrtc/webrtcsessiondescriptionfactory.h
index 91adc66..3281bb5c 100644
--- a/talk/app/webrtc/webrtcsessiondescriptionfactory.h
+++ b/talk/app/webrtc/webrtcsessiondescriptionfactory.h
@@ -31,9 +31,9 @@
 #include "talk/app/webrtc/dtlsidentitystore.h"
 #include "talk/app/webrtc/peerconnectioninterface.h"
 #include "talk/session/media/mediasession.h"
-#include "webrtc/p2p/base/transportdescriptionfactory.h"
 #include "webrtc/base/messagehandler.h"
 #include "webrtc/base/rtccertificate.h"
+#include "webrtc/p2p/base/transportdescriptionfactory.h"
 
 namespace cricket {
 class ChannelManager;
diff --git a/talk/build/common.gypi b/talk/build/common.gypi
index 061b06b..028c006 100644
--- a/talk/build/common.gypi
+++ b/talk/build/common.gypi
@@ -30,7 +30,6 @@
 {
   'variables': {
     'webrtc_root%': '<(DEPTH)/webrtc',
-    'libjingle_tests_additional_deps%': [],
     # TODO(ronghuawu): For now, disable the Chrome plugins, which causes a
     # flood of chromium-style warnings.
     'clang_use_chrome_plugins%': 0,
@@ -43,8 +42,6 @@
     'build_expat%': 1,
     'build_json%': 1,
     'build_libsrtp%': 1,
-    'build_libyuv%': 1,
-    'build_usrsctp%': 1,
     # Make it possible to provide custom locations for some libraries.
     'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
 
@@ -65,8 +62,6 @@
       # Feature selection
       'HAVE_SCTP',
       'HAVE_SRTP',
-      'HAVE_WEBRTC_VIDEO',
-      'HAVE_WEBRTC_VOICE',
     ],
     'conditions': [
       ['OS=="linux"', {
diff --git a/talk/libjingle.gyp b/talk/libjingle.gyp
index 3254808..ba2935e 100755
--- a/talk/libjingle.gyp
+++ b/talk/libjingle.gyp
@@ -440,272 +440,11 @@
 
   'targets': [
     {
-      'target_name': 'libjingle',
-      'type': 'none',
-      'dependencies': [
-        '<(webrtc_root)/base/base.gyp:rtc_base',
-      ],
-      'conditions': [
-        ['build_json==1', {
-          'dependencies': [
-            '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
-          ],
-          'export_dependent_settings': [
-            '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
-          ],
-        }],
-        ['build_expat==1', {
-          'dependencies': [
-            '<(DEPTH)/third_party/expat/expat.gyp:expat',
-          ],
-          'export_dependent_settings': [
-            '<(DEPTH)/third_party/expat/expat.gyp:expat',
-          ],
-        }],
-      ],
-    },  # target libjingle
-    {
-      'target_name': 'libjingle_media',
-      'type': 'static_library',
-      'dependencies': [
-        '<(webrtc_root)/common.gyp:webrtc_common',
-        '<(webrtc_root)/modules/modules.gyp:video_render_module',
-        '<(webrtc_root)/webrtc.gyp:webrtc',
-        '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine',
-        '<(webrtc_root)/sound/sound.gyp:rtc_sound',
-        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
-        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
-        '<(webrtc_root)/libjingle/xmllite/xmllite.gyp:rtc_xmllite',
-        '<(webrtc_root)/libjingle/xmpp/xmpp.gyp:rtc_xmpp',
-        '<(webrtc_root)/p2p/p2p.gyp:rtc_p2p',
-        'libjingle',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '<(libyuv_dir)/include',
-        ],
-      },
-      'sources': [
-        'media/base/audioframe.h',
-        'media/base/audiorenderer.h',
-        'media/base/capturemanager.cc',
-        'media/base/capturemanager.h',
-        'media/base/capturerenderadapter.cc',
-        'media/base/capturerenderadapter.h',
-        'media/base/codec.cc',
-        'media/base/codec.h',
-        'media/base/constants.cc',
-        'media/base/constants.h',
-        'media/base/cpuid.cc',
-        'media/base/cpuid.h',
-        'media/base/cryptoparams.h',
-        'media/base/device.h',
-        'media/base/fakescreencapturerfactory.h',
-        'media/base/hybriddataengine.h',
-        'media/base/mediachannel.h',
-        'media/base/mediacommon.h',
-        'media/base/mediaengine.cc',
-        'media/base/mediaengine.h',
-        'media/base/rtpdataengine.cc',
-        'media/base/rtpdataengine.h',
-        'media/base/rtpdump.cc',
-        'media/base/rtpdump.h',
-        'media/base/rtputils.cc',
-        'media/base/rtputils.h',
-        'media/base/screencastid.h',
-        'media/base/streamparams.cc',
-        'media/base/streamparams.h',
-        'media/base/turnutils.cc',
-        'media/base/turnutils.h',
-        'media/base/videoadapter.cc',
-        'media/base/videoadapter.h',
-        'media/base/videocapturer.cc',
-        'media/base/videocapturer.h',
-        'media/base/videocapturerfactory.h',
-        'media/base/videocommon.cc',
-        'media/base/videocommon.h',
-        'media/base/videoframe.cc',
-        'media/base/videoframe.h',
-        'media/base/videoframefactory.cc',
-        'media/base/videoframefactory.h',
-        'media/base/videorenderer.h',
-        'media/base/yuvframegenerator.cc',
-        'media/base/yuvframegenerator.h',
-        'media/devices/deviceinfo.h',
-        'media/devices/devicemanager.cc',
-        'media/devices/devicemanager.h',
-        'media/devices/dummydevicemanager.h',
-        'media/devices/filevideocapturer.cc',
-        'media/devices/filevideocapturer.h',
-        'media/devices/videorendererfactory.h',
-        'media/devices/yuvframescapturer.cc',
-        'media/devices/yuvframescapturer.h',
-        'media/sctp/sctpdataengine.cc',
-        'media/sctp/sctpdataengine.h',
-        'media/webrtc/nullwebrtcvideoengine.h',
-        'media/webrtc/simulcast.cc',
-        'media/webrtc/simulcast.h',
-        'media/webrtc/webrtccommon.h',
-        'media/webrtc/webrtcmediaengine.cc',
-        'media/webrtc/webrtcmediaengine.h',
-        'media/webrtc/webrtcmediaengine.cc',
-        'media/webrtc/webrtcvideocapturer.cc',
-        'media/webrtc/webrtcvideocapturer.h',
-        'media/webrtc/webrtcvideocapturerfactory.h',
-        'media/webrtc/webrtcvideocapturerfactory.cc',
-        'media/webrtc/webrtcvideodecoderfactory.h',
-        'media/webrtc/webrtcvideoencoderfactory.h',
-        'media/webrtc/webrtcvideoengine2.cc',
-        'media/webrtc/webrtcvideoengine2.h',
-        'media/webrtc/webrtcvideoframe.cc',
-        'media/webrtc/webrtcvideoframe.h',
-        'media/webrtc/webrtcvideoframefactory.cc',
-        'media/webrtc/webrtcvideoframefactory.h',
-        'media/webrtc/webrtcvoe.h',
-        'media/webrtc/webrtcvoiceengine.cc',
-        'media/webrtc/webrtcvoiceengine.h',
-      ],
-      'conditions': [
-        ['build_libyuv==1', {
-          'dependencies': ['<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',],
-        }],
-        ['build_usrsctp==1', {
-          'include_dirs': [
-            # TODO(jiayl): move this into the direct_dependent_settings of
-            # usrsctp.gyp.
-            '<(DEPTH)/third_party/usrsctp/usrsctplib',
-          ],
-          'dependencies': [
-            '<(DEPTH)/third_party/usrsctp/usrsctp.gyp:usrsctplib',
-          ],
-        }],
-        ['build_with_chromium==1', {
-          'dependencies': [
-            '<(webrtc_root)/modules/modules.gyp:video_capture',
-            '<(webrtc_root)/modules/modules.gyp:video_render',
-          ],
-        }, {
-          'dependencies': [
-            '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
-            '<(webrtc_root)/modules/modules.gyp:video_render_module_internal_impl',
-          ],
-        }],
-        ['OS=="linux"', {
-          'sources': [
-            'media/devices/libudevsymboltable.cc',
-            'media/devices/libudevsymboltable.h',
-            'media/devices/linuxdeviceinfo.cc',
-            'media/devices/linuxdevicemanager.cc',
-            'media/devices/linuxdevicemanager.h',
-            'media/devices/v4llookup.cc',
-            'media/devices/v4llookup.h',
-          ],
-          'conditions': [
-            ['use_gtk==1', {
-              'sources': [
-                'media/devices/gtkvideorenderer.cc',
-                'media/devices/gtkvideorenderer.h',
-              ],
-              'cflags': [
-                '<!@(pkg-config --cflags gobject-2.0 gthread-2.0 gtk+-2.0)',
-              ],
-            }],
-          ],
-          'include_dirs': [
-            'third_party/libudev'
-          ],
-          'libraries': [
-            '-lrt',
-          ],
-        }],
-        ['OS=="win"', {
-          'sources': [
-            'media/devices/gdivideorenderer.cc',
-            'media/devices/gdivideorenderer.h',
-            'media/devices/win32deviceinfo.cc',
-            'media/devices/win32devicemanager.cc',
-            'media/devices/win32devicemanager.h',
-          ],
-          'msvs_settings': {
-            'VCLibrarianTool': {
-              'AdditionalDependencies': [
-                'd3d9.lib',
-                'gdi32.lib',
-                'strmiids.lib',
-                'winmm.lib',
-              ],
-            },
-          },
-        }],
-        ['OS=="mac"', {
-          'sources': [
-            'media/devices/macdeviceinfo.cc',
-            'media/devices/macdevicemanager.cc',
-            'media/devices/macdevicemanager.h',
-            'media/devices/macdevicemanagermm.mm',
-          ],
-          'conditions': [
-            ['target_arch=="ia32"', {
-              'sources': [
-                'media/devices/carbonvideorenderer.cc',
-                'media/devices/carbonvideorenderer.h',
-              ],
-              'link_settings': {
-                'xcode_settings': {
-                  'OTHER_LDFLAGS': [
-                    '-framework Carbon',
-                  ],
-                },
-              },
-            }],
-          ],
-          'xcode_settings': {
-            'WARNING_CFLAGS': [
-              # TODO(ronghuawu): Update macdevicemanager.cc to stop using
-              # deprecated functions and remove this flag.
-              '-Wno-deprecated-declarations',
-            ],
-            # Disable partial availability warning to prevent errors
-            # in macdevicemanagermm.mm using AVFoundation.
-            # https://code.google.com/p/webrtc/issues/detail?id=4695
-            'WARNING_CFLAGS!': ['-Wpartial-availability'],
-          },
-          'link_settings': {
-            'xcode_settings': {
-              'OTHER_LDFLAGS': [
-                '-weak_framework AVFoundation',
-                '-framework Cocoa',
-                '-framework CoreAudio',
-                '-framework CoreVideo',
-                '-framework OpenGL',
-                '-framework QTKit',
-              ],
-            },
-          },
-        }],
-        ['OS=="ios"', {
-          'sources': [
-            'media/devices/mobiledevicemanager.cc',
-          ],
-          'include_dirs': [
-            # TODO(sjlee) Remove when vp8 is building for iOS.  vp8 pulls in
-            # libjpeg which pulls in libyuv which currently disabled.
-            '../third_party/libyuv/include',
-          ],
-        }],
-        ['OS=="android"', {
-          'sources': [
-            'media/devices/mobiledevicemanager.cc',
-          ],
-        }],
-      ],
-    },  # target libjingle_media
-    {
       'target_name': 'libjingle_p2p',
       'type': 'static_library',
       'dependencies': [
-        'libjingle',
-        'libjingle_media',
+        '<(webrtc_root)/base/base.gyp:rtc_base',
+        '<(webrtc_root)/media/media.gyp:rtc_media',
       ],
       'conditions': [
         ['build_libsrtp==1', {
@@ -755,8 +494,8 @@
       'target_name': 'libjingle_peerconnection',
       'type': 'static_library',
       'dependencies': [
-        'libjingle',
-        'libjingle_media',
+        '<(webrtc_root)/base/base.gyp:rtc_base',
+        '<(webrtc_root)/media/media.gyp:rtc_media',
         'libjingle_p2p',
       ],
       'sources': [
diff --git a/talk/libjingle_media_unittest.isolate b/talk/libjingle_media_unittest.isolate
deleted file mode 100644
index 8884047..0000000
--- a/talk/libjingle_media_unittest.isolate
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# libjingle
-# Copyright 2013 Google Inc.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#  1. Redistributions of source code must retain the above copyright notice,
-#     this list of conditions and the following disclaimer.
-#  2. Redistributions in binary form must reproduce the above copyright notice,
-#     this list of conditions and the following disclaimer in the documentation
-#     and/or other materials provided with the distribution.
-#  3. The name of the author may not be used to endorse or promote products
-#     derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
-  'conditions': [
-    ['OS=="linux" or OS=="mac" or OS=="win"', {
-      'variables': {
-        'command': [
-          '<(PRODUCT_DIR)/libjingle_media_unittest<(EXECUTABLE_SUFFIX)',
-        ],
-        'files': [
-          '<(PRODUCT_DIR)/libjingle_media_unittest<(EXECUTABLE_SUFFIX)',
-          'media/testdata/captured-320x240-2s-48.frames',
-          'media/testdata/faces.1280x720_P420.yuv',
-          'media/testdata/faces_I420.jpg',
-          'media/testdata/faces_I422.jpg',
-          'media/testdata/faces_I444.jpg',
-          'media/testdata/faces_I411.jpg',
-          'media/testdata/faces_I400.jpg',
-        ],
-      },
-    }],
-  ],
-}
diff --git a/talk/libjingle_tests.gyp b/talk/libjingle_tests.gyp
index cbf25aa..fb6bbf9 100755
--- a/talk/libjingle_tests.gyp
+++ b/talk/libjingle_tests.gyp
@@ -28,135 +28,13 @@
   'includes': ['build/common.gypi'],
   'targets': [
     {
-      'target_name': 'libjingle_unittest_main',
-      'type': 'static_library',
-      'dependencies': [
-        '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
-        '<@(libjingle_tests_additional_deps)',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '<(libyuv_dir)/include',
-          '<(DEPTH)/testing/gtest/include',
-          '<(DEPTH)/testing/gtest',
-        ],
-      },
-      'conditions': [
-        ['build_libyuv==1', {
-          'dependencies': ['<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',],
-        }],
-      ],
-      'include_dirs': [
-         '<(DEPTH)/testing/gtest/include',
-         '<(DEPTH)/testing/gtest',
-       ],
-      'sources': [
-        'media/base/fakecapturemanager.h',
-        'media/base/fakemediaengine.h',
-        'media/base/fakenetworkinterface.h',
-        'media/base/fakertp.h',
-        'media/base/fakevideocapturer.h',
-        'media/base/fakevideorenderer.h',
-        'media/base/testutils.cc',
-        'media/base/testutils.h',
-        'media/devices/fakedevicemanager.h',
-        'media/webrtc/fakewebrtccall.cc',
-        'media/webrtc/fakewebrtccall.h',
-        'media/webrtc/fakewebrtccommon.h',
-        'media/webrtc/fakewebrtcdeviceinfo.h',
-        'media/webrtc/fakewebrtcvcmfactory.h',
-        'media/webrtc/fakewebrtcvideocapturemodule.h',
-        'media/webrtc/fakewebrtcvideoengine.h',
-        'media/webrtc/fakewebrtcvoiceengine.h',
-      ],
-    },  # target libjingle_unittest_main
-    {
-      'target_name': 'libjingle_media_unittest',
-      'type': 'executable',
-      'dependencies': [
-        '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
-        'libjingle.gyp:libjingle_media',
-        'libjingle_unittest_main',
-      ],
-      'sources': [
-        'media/base/capturemanager_unittest.cc',
-        'media/base/codec_unittest.cc',
-        'media/base/rtpdataengine_unittest.cc',
-        'media/base/rtpdump_unittest.cc',
-        'media/base/rtputils_unittest.cc',
-        'media/base/streamparams_unittest.cc',
-        'media/base/testutils.cc',
-        'media/base/testutils.h',
-        'media/base/turnutils_unittest.cc',
-        'media/base/videoadapter_unittest.cc',
-        'media/base/videocapturer_unittest.cc',
-        'media/base/videocommon_unittest.cc',
-        'media/base/videoengine_unittest.h',
-        'media/base/videoframe_unittest.h',
-        'media/devices/dummydevicemanager_unittest.cc',
-        'media/devices/filevideocapturer_unittest.cc',
-        'media/sctp/sctpdataengine_unittest.cc',
-        'media/webrtc/nullwebrtcvideoengine_unittest.cc',
-        'media/webrtc/simulcast_unittest.cc',
-        'media/webrtc/webrtcmediaengine_unittest.cc',
-        'media/webrtc/webrtcvideocapturer_unittest.cc',
-        'media/webrtc/webrtcvideoframe_unittest.cc',
-        'media/webrtc/webrtcvideoframefactory_unittest.cc',
-        # Disabled because some tests fail.
-        # TODO(ronghuawu): Reenable these tests.
-        # 'media/devices/devicemanager_unittest.cc',
-        'media/webrtc/webrtcvideoengine2_unittest.cc',
-        'media/webrtc/webrtcvoiceengine_unittest.cc',
-      ],
-      'conditions': [
-        ['OS=="win"', {
-          'conditions': [
-            ['use_openssl==0', {
-              'dependencies': [
-                '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
-                '<(DEPTH)/third_party/nss/nss.gyp:nspr',
-                '<(DEPTH)/third_party/nss/nss.gyp:nss',
-              ],
-            }],
-          ],
-          'msvs_settings': {
-            'VCLinkerTool': {
-              'AdditionalDependencies': [
-                # TODO(ronghuawu): Since we've included strmiids in
-                # libjingle_media target, we shouldn't need this here.
-                # Find out why it doesn't work without this.
-                'strmiids.lib',
-              ],
-            },
-          },
-        }],
-        ['OS=="win" and clang==1', {
-          'msvs_settings': {
-            'VCCLCompilerTool': {
-              'AdditionalOptions': [
-                # Disable warnings failing when compiling with Clang on Windows.
-                # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
-                '-Wno-unused-function',
-              ],
-            },
-          },
-        },],
-        ['OS=="ios"', {
-          'sources!': [
-            'media/sctp/sctpdataengine_unittest.cc',
-          ],
-        }],
-      ],
-    },  # target libjingle_media_unittest
-    {
       'target_name': 'libjingle_p2p_unittest',
       'type': 'executable',
       'dependencies': [
         '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
-        'libjingle.gyp:libjingle',
+        '<(webrtc_root)/webrtc.gyp:rtc_unittest_main',
         'libjingle.gyp:libjingle_peerconnection',
         'libjingle.gyp:libjingle_p2p',
-        'libjingle_unittest_main',
       ],
       'include_dirs': [
         '<(DEPTH)/third_party/libsrtp/srtp',
@@ -194,10 +72,9 @@
         '<(DEPTH)/testing/gmock.gyp:gmock',
         '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
         '<(webrtc_root)/common.gyp:webrtc_common',
-        'libjingle.gyp:libjingle',
+        '<(webrtc_root)/webrtc.gyp:rtc_unittest_main',
         'libjingle.gyp:libjingle_p2p',
         'libjingle.gyp:libjingle_peerconnection',
-        'libjingle_unittest_main',
       ],
       'direct_dependent_settings': {
         'include_dirs': [
@@ -427,19 +304,6 @@
     ['test_isolation_mode != "noop"', {
       'targets': [
         {
-          'target_name': 'libjingle_media_unittest_run',
-          'type': 'none',
-          'dependencies': [
-            'libjingle_media_unittest',
-          ],
-          'includes': [
-            'build/isolate.gypi',
-          ],
-          'sources': [
-            'libjingle_media_unittest.isolate',
-          ],
-        },
-        {
           'target_name': 'libjingle_p2p_unittest_run',
           'type': 'none',
           'dependencies': [
diff --git a/talk/media/OWNERS b/talk/media/OWNERS
deleted file mode 100644
index eeabb99..0000000
--- a/talk/media/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-mflodman@webrtc.org
-pbos@webrtc.org
-pthatcher@webrtc.org
-solenberg@webrtc.org
diff --git a/talk/media/testdata/1.frame_plus_1.byte b/talk/media/testdata/1.frame_plus_1.byte
deleted file mode 100644
index b619ede..0000000
--- a/talk/media/testdata/1.frame_plus_1.byte
+++ /dev/null
Binary files differ
diff --git a/talk/media/testdata/captured-320x240-2s-48.frames b/talk/media/testdata/captured-320x240-2s-48.frames
deleted file mode 100644
index 292a170..0000000
--- a/talk/media/testdata/captured-320x240-2s-48.frames
+++ /dev/null
Binary files differ
diff --git a/talk/media/testdata/faces_I400.jpg b/talk/media/testdata/faces_I400.jpg
deleted file mode 100644
index c928f00..0000000
--- a/talk/media/testdata/faces_I400.jpg
+++ /dev/null
Binary files differ
diff --git a/talk/media/testdata/faces_I411.jpg b/talk/media/testdata/faces_I411.jpg
deleted file mode 100644
index 600c122..0000000
--- a/talk/media/testdata/faces_I411.jpg
+++ /dev/null
Binary files differ
diff --git a/talk/media/testdata/faces_I420.jpg b/talk/media/testdata/faces_I420.jpg
deleted file mode 100644
index 10c5332..0000000
--- a/talk/media/testdata/faces_I420.jpg
+++ /dev/null
Binary files differ
diff --git a/talk/media/testdata/faces_I422.jpg b/talk/media/testdata/faces_I422.jpg
deleted file mode 100644
index 9907aa1..0000000
--- a/talk/media/testdata/faces_I422.jpg
+++ /dev/null
Binary files differ
diff --git a/talk/media/testdata/faces_I444.jpg b/talk/media/testdata/faces_I444.jpg
deleted file mode 100644
index 3422755..0000000
--- a/talk/media/testdata/faces_I444.jpg
+++ /dev/null
Binary files differ
diff --git a/talk/media/testdata/h264-svc-99-640x360.rtpdump b/talk/media/testdata/h264-svc-99-640x360.rtpdump
deleted file mode 100644
index ffa521d..0000000
--- a/talk/media/testdata/h264-svc-99-640x360.rtpdump
+++ /dev/null
Binary files differ
diff --git a/talk/media/testdata/video.rtpdump b/talk/media/testdata/video.rtpdump
deleted file mode 100644
index 7be863e..0000000
--- a/talk/media/testdata/video.rtpdump
+++ /dev/null
Binary files differ
diff --git a/talk/media/testdata/voice.rtpdump b/talk/media/testdata/voice.rtpdump
deleted file mode 100644
index 8f0ec15..0000000
--- a/talk/media/testdata/voice.rtpdump
+++ /dev/null
Binary files differ
diff --git a/talk/session/media/audiomonitor.h b/talk/session/media/audiomonitor.h
index 3723419..7d96066 100644
--- a/talk/session/media/audiomonitor.h
+++ b/talk/session/media/audiomonitor.h
@@ -29,9 +29,9 @@
 #define TALK_SESSION_MEDIA_AUDIOMONITOR_H_
 
 #include <vector>
-#include "webrtc/p2p/base/port.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/p2p/base/port.h"
 
 namespace cricket {
 
diff --git a/talk/session/media/bundlefilter.cc b/talk/session/media/bundlefilter.cc
old mode 100755
new mode 100644
index 670befe..2cb4701
--- a/talk/session/media/bundlefilter.cc
+++ b/talk/session/media/bundlefilter.cc
@@ -27,8 +27,8 @@
 
 #include "talk/session/media/bundlefilter.h"
 
-#include "talk/media/base/rtputils.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/base/rtputils.h"
 
 namespace cricket {
 
diff --git a/talk/session/media/bundlefilter.h b/talk/session/media/bundlefilter.h
old mode 100755
new mode 100644
index d9d952f..a64e6a4
--- a/talk/session/media/bundlefilter.h
+++ b/talk/session/media/bundlefilter.h
@@ -33,8 +33,8 @@
 #include <set>
 #include <vector>
 
-#include "talk/media/base/streamparams.h"
 #include "webrtc/base/basictypes.h"
+#include "webrtc/media/base/streamparams.h"
 
 namespace cricket {
 
diff --git a/talk/session/media/channel.cc b/talk/session/media/channel.cc
index 592f22d..bee3771 100644
--- a/talk/session/media/channel.cc
+++ b/talk/session/media/channel.cc
@@ -29,8 +29,6 @@
 
 #include "talk/session/media/channel.h"
 
-#include "talk/media/base/constants.h"
-#include "talk/media/base/rtputils.h"
 #include "talk/session/media/channelmanager.h"
 #include "webrtc/audio/audio_sink.h"
 #include "webrtc/base/bind.h"
@@ -40,6 +38,8 @@
 #include "webrtc/base/dscp.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/trace_event.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/rtputils.h"
 #include "webrtc/p2p/base/transportchannel.h"
 
 namespace cricket {
diff --git a/talk/session/media/channel.h b/talk/session/media/channel.h
index a05828b..dfc0ce5 100644
--- a/talk/session/media/channel.h
+++ b/talk/session/media/channel.h
@@ -28,16 +28,12 @@
 #ifndef TALK_SESSION_MEDIA_CHANNEL_H_
 #define TALK_SESSION_MEDIA_CHANNEL_H_
 
-#include <string>
-#include <vector>
 #include <map>
 #include <set>
+#include <string>
 #include <utility>
+#include <vector>
 
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/mediaengine.h"
-#include "talk/media/base/streamparams.h"
-#include "talk/media/base/videocapturer.h"
 #include "talk/session/media/audiomonitor.h"
 #include "talk/session/media/bundlefilter.h"
 #include "talk/session/media/mediamonitor.h"
@@ -50,6 +46,10 @@
 #include "webrtc/base/network.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/window.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/mediaengine.h"
+#include "webrtc/media/base/streamparams.h"
+#include "webrtc/media/base/videocapturer.h"
 #include "webrtc/media/base/videosinkinterface.h"
 #include "webrtc/p2p/base/transportcontroller.h"
 #include "webrtc/p2p/client/socketmonitor.h"
diff --git a/talk/session/media/channel_unittest.cc b/talk/session/media/channel_unittest.cc
index 28165c3..5bbe1e7 100644
--- a/talk/session/media/channel_unittest.cc
+++ b/talk/session/media/channel_unittest.cc
@@ -25,14 +25,6 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/fakemediaengine.h"
-#include "talk/media/base/fakertp.h"
-#include "talk/media/base/fakescreencapturerfactory.h"
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/rtpdump.h"
-#include "talk/media/base/screencastid.h"
-#include "talk/media/base/testutils.h"
 #include "talk/session/media/channel.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/fileutils.h"
@@ -44,6 +36,14 @@
 #include "webrtc/base/ssladapter.h"
 #include "webrtc/base/sslidentity.h"
 #include "webrtc/base/window.h"
+#include "webrtc/media/base/fakemediaengine.h"
+#include "webrtc/media/base/fakertp.h"
+#include "webrtc/media/base/fakescreencapturerfactory.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/rtpdump.h"
+#include "webrtc/media/base/screencastid.h"
+#include "webrtc/media/base/testutils.h"
 #include "webrtc/p2p/base/faketransportcontroller.h"
 
 #define MAYBE_SKIP_TEST(feature)                    \
diff --git a/talk/session/media/channelmanager.cc b/talk/session/media/channelmanager.cc
index 7973f5c..bfecb58 100644
--- a/talk/session/media/channelmanager.cc
+++ b/talk/session/media/channelmanager.cc
@@ -34,13 +34,13 @@
 #include <algorithm>
 
 #include "talk/app/webrtc/mediacontroller.h"
-#include "talk/media/base/capturemanager.h"
-#include "talk/media/base/device.h"
-#include "talk/media/base/hybriddataengine.h"
-#include "talk/media/base/rtpdataengine.h"
-#include "talk/media/base/videocapturer.h"
+#include "webrtc/media/base/capturemanager.h"
+#include "webrtc/media/base/device.h"
+#include "webrtc/media/base/hybriddataengine.h"
+#include "webrtc/media/base/rtpdataengine.h"
+#include "webrtc/media/base/videocapturer.h"
 #ifdef HAVE_SCTP
-#include "talk/media/sctp/sctpdataengine.h"
+#include "webrtc/media/sctp/sctpdataengine.h"
 #endif
 #include "talk/session/media/srtpfilter.h"
 #include "webrtc/base/bind.h"
diff --git a/talk/session/media/channelmanager.h b/talk/session/media/channelmanager.h
index 6f44e42..de85552 100644
--- a/talk/session/media/channelmanager.h
+++ b/talk/session/media/channelmanager.h
@@ -31,13 +31,13 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/capturemanager.h"
-#include "talk/media/base/mediaengine.h"
 #include "talk/session/media/voicechannel.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/fileutils.h"
 #include "webrtc/base/sigslotrepeater.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/capturemanager.h"
+#include "webrtc/media/base/mediaengine.h"
 
 namespace webrtc {
 class MediaControllerInterface;
diff --git a/talk/session/media/channelmanager_unittest.cc b/talk/session/media/channelmanager_unittest.cc
index 4740f0f..81faad4 100644
--- a/talk/session/media/channelmanager_unittest.cc
+++ b/talk/session/media/channelmanager_unittest.cc
@@ -26,15 +26,15 @@
  */
 
 #include "talk/app/webrtc/fakemediacontroller.h"
-#include "talk/media/base/fakecapturemanager.h"
-#include "talk/media/base/fakemediaengine.h"
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/testutils.h"
-#include "talk/media/webrtc/fakewebrtccall.h"
 #include "talk/session/media/channelmanager.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/fakecapturemanager.h"
+#include "webrtc/media/base/fakemediaengine.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/webrtc/fakewebrtccall.h"
 #include "webrtc/p2p/base/faketransportcontroller.h"
 
 namespace cricket {
diff --git a/talk/session/media/currentspeakermonitor.cc b/talk/session/media/currentspeakermonitor.cc
index 52a0d0c..4008f0e 100644
--- a/talk/session/media/currentspeakermonitor.cc
+++ b/talk/session/media/currentspeakermonitor.cc
@@ -27,9 +27,9 @@
 
 #include "talk/session/media/currentspeakermonitor.h"
 
-#include "talk/media/base/streamparams.h"
 #include "talk/session/media/audiomonitor.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/base/streamparams.h"
 
 namespace cricket {
 
diff --git a/talk/session/media/externalhmac.cc b/talk/session/media/externalhmac.cc
index d63520e..dd991d4 100644
--- a/talk/session/media/externalhmac.cc
+++ b/talk/session/media/externalhmac.cc
@@ -33,11 +33,11 @@
 
 extern "C" {
 #ifdef SRTP_RELATIVE_PATH
-#include "srtp.h"  // NOLINT
 #include "crypto_kernel.h"  // NOLINT
+#include "srtp.h"  // NOLINT
 #else
-#include "third_party/libsrtp/srtp/include/srtp.h"
 #include "third_party/libsrtp/srtp/crypto/include/crypto_kernel.h"
+#include "third_party/libsrtp/srtp/include/srtp.h"
 #endif  // SRTP_RELATIVE_PATH
 }
 
diff --git a/talk/session/media/mediamonitor.h b/talk/session/media/mediamonitor.h
index 445b379..0a02e96 100644
--- a/talk/session/media/mediamonitor.h
+++ b/talk/session/media/mediamonitor.h
@@ -30,11 +30,11 @@
 #ifndef TALK_SESSION_MEDIA_MEDIAMONITOR_H_
 #define TALK_SESSION_MEDIA_MEDIAMONITOR_H_
 
-#include "talk/media/base/mediachannel.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/thread.h"
 #include "webrtc/base/thread_annotations.h"
+#include "webrtc/media/base/mediachannel.h"
 
 namespace cricket {
 
diff --git a/talk/session/media/mediasession.cc b/talk/session/media/mediasession.cc
index 24f01b4..b6f52c2 100644
--- a/talk/session/media/mediasession.cc
+++ b/talk/session/media/mediasession.cc
@@ -32,18 +32,18 @@
 #include <set>
 #include <utility>
 
-#include "talk/media/base/constants.h"
-#include "talk/media/base/cryptoparams.h"
 #include "talk/session/media/channelmanager.h"
 #include "talk/session/media/srtpfilter.h"
 #include "webrtc/base/helpers.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/stringutils.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/cryptoparams.h"
 #include "webrtc/p2p/base/constants.h"
 
 #ifdef HAVE_SCTP
-#include "talk/media/sctp/sctpdataengine.h"
+#include "webrtc/media/sctp/sctpdataengine.h"
 #else
 static const uint32_t kMaxSctpSid = 1023;
 #endif
diff --git a/talk/session/media/mediasession.h b/talk/session/media/mediasession.h
index 1540274..17a2c1b 100644
--- a/talk/session/media/mediasession.h
+++ b/talk/session/media/mediasession.h
@@ -34,16 +34,16 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/codec.h"
-#include "talk/media/base/constants.h"
-#include "talk/media/base/cryptoparams.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/mediaengine.h"  // For DataChannelType
-#include "talk/media/base/streamparams.h"
+#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/cryptoparams.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/mediaengine.h"  // For DataChannelType
+#include "webrtc/media/base/streamparams.h"
 #include "webrtc/p2p/base/sessiondescription.h"
 #include "webrtc/p2p/base/transport.h"
 #include "webrtc/p2p/base/transportdescriptionfactory.h"
-#include "webrtc/base/scoped_ptr.h"
 
 namespace cricket {
 
diff --git a/talk/session/media/mediasession_unittest.cc b/talk/session/media/mediasession_unittest.cc
index 20b72e9..7c61d64 100644
--- a/talk/session/media/mediasession_unittest.cc
+++ b/talk/session/media/mediasession_unittest.cc
@@ -28,17 +28,17 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/codec.h"
-#include "talk/media/base/testutils.h"
-#include "webrtc/p2p/base/constants.h"
-#include "webrtc/p2p/base/transportdescription.h"
-#include "webrtc/p2p/base/transportinfo.h"
 #include "talk/session/media/mediasession.h"
 #include "talk/session/media/srtpfilter.h"
 #include "webrtc/base/fakesslidentity.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/messagedigest.h"
 #include "webrtc/base/ssladapter.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/p2p/base/constants.h"
+#include "webrtc/p2p/base/transportdescription.h"
+#include "webrtc/p2p/base/transportinfo.h"
 
 #ifdef HAVE_SRTP
 #define ASSERT_CRYPTO(cd, s, cs) \
diff --git a/talk/session/media/planarfunctions_unittest.cc b/talk/session/media/planarfunctions_unittest.cc
index 886aa59..9e5624b 100644
--- a/talk/session/media/planarfunctions_unittest.cc
+++ b/talk/session/media/planarfunctions_unittest.cc
@@ -32,11 +32,11 @@
 #include "libyuv/convert_from_argb.h"
 #include "libyuv/mjpeg_decoder.h"
 #include "libyuv/planar_functions.h"
-#include "talk/media/base/testutils.h"
-#include "talk/media/base/videocommon.h"
 #include "webrtc/base/flags.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/base/videocommon.h"
 
 // Undefine macros for the windows build.
 #undef max
diff --git a/talk/session/media/rtcpmuxfilter.h b/talk/session/media/rtcpmuxfilter.h
index 8888fd4..ad5f5c1 100644
--- a/talk/session/media/rtcpmuxfilter.h
+++ b/talk/session/media/rtcpmuxfilter.h
@@ -28,8 +28,8 @@
 #ifndef TALK_SESSION_MEDIA_RTCPMUXFILTER_H_
 #define TALK_SESSION_MEDIA_RTCPMUXFILTER_H_
 
-#include "webrtc/p2p/base/sessiondescription.h"
 #include "webrtc/base/basictypes.h"
+#include "webrtc/p2p/base/sessiondescription.h"
 
 namespace cricket {
 
diff --git a/talk/session/media/rtcpmuxfilter_unittest.cc b/talk/session/media/rtcpmuxfilter_unittest.cc
index d4e6376..edc4b39 100644
--- a/talk/session/media/rtcpmuxfilter_unittest.cc
+++ b/talk/session/media/rtcpmuxfilter_unittest.cc
@@ -27,8 +27,8 @@
 
 #include "talk/session/media/rtcpmuxfilter.h"
 
-#include "talk/media/base/testutils.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/base/testutils.h"
 
 TEST(RtcpMuxFilterTest, DemuxRtcpSender) {
   cricket::RtcpMuxFilter filter;
diff --git a/talk/session/media/srtpfilter.cc b/talk/session/media/srtpfilter.cc
index a200a3c..4e6cbe8 100644
--- a/talk/session/media/srtpfilter.cc
+++ b/talk/session/media/srtpfilter.cc
@@ -33,13 +33,13 @@
 
 #include <algorithm>
 
-#include "talk/media/base/rtputils.h"
 #include "webrtc/base/base64.h"
 #include "webrtc/base/byteorder.h"
 #include "webrtc/base/common.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/stringencode.h"
 #include "webrtc/base/timeutils.h"
+#include "webrtc/media/base/rtputils.h"
 
 // Enable this line to turn on SRTP debugging
 // #define SRTP_DEBUG
diff --git a/talk/session/media/srtpfilter.h b/talk/session/media/srtpfilter.h
index 6b941f3..eaf5c43 100644
--- a/talk/session/media/srtpfilter.h
+++ b/talk/session/media/srtpfilter.h
@@ -33,13 +33,13 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/cryptoparams.h"
-#include "webrtc/p2p/base/sessiondescription.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/sigslotrepeater.h"
 #include "webrtc/base/sslstreamadapter.h"
+#include "webrtc/media/base/cryptoparams.h"
+#include "webrtc/p2p/base/sessiondescription.h"
 
 // Forward declaration to avoid pulling in libsrtp headers here
 struct srtp_event_data_t;
diff --git a/talk/session/media/srtpfilter_unittest.cc b/talk/session/media/srtpfilter_unittest.cc
index 1187438..af1ea33 100644
--- a/talk/session/media/srtpfilter_unittest.cc
+++ b/talk/session/media/srtpfilter_unittest.cc
@@ -25,13 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/cryptoparams.h"
-#include "talk/media/base/fakertp.h"
-#include "webrtc/p2p/base/sessiondescription.h"
 #include "talk/session/media/srtpfilter.h"
 #include "webrtc/base/byteorder.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/cryptoparams.h"
+#include "webrtc/media/base/fakertp.h"
+#include "webrtc/p2p/base/sessiondescription.h"
 extern "C" {
 #ifdef SRTP_RELATIVE_PATH
 #include "crypto/include/err.h"
diff --git a/talk/session/media/yuvscaler_unittest.cc b/talk/session/media/yuvscaler_unittest.cc
index b6b0637..a555f88 100644
--- a/talk/session/media/yuvscaler_unittest.cc
+++ b/talk/session/media/yuvscaler_unittest.cc
@@ -29,11 +29,11 @@
 
 #include "libyuv/cpu_id.h"
 #include "libyuv/scale.h"
-#include "talk/media/base/testutils.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/flags.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/testutils.h"
 
 #if defined(_MSC_VER)
 #define ALIGN16(var) __declspec(align(16)) var
diff --git a/webrtc/api/api.gyp b/webrtc/api/api.gyp
index ec51b47..ac4ea84 100644
--- a/webrtc/api/api.gyp
+++ b/webrtc/api/api.gyp
@@ -91,7 +91,17 @@
                     '-framework QuartzCore',
                   ]
                 }
-              }
+              },
+              # TODO(kjellander): Make the code compile without disabling these.
+              # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
+              'cflags': [
+                '-Wno-return-type',
+              ],
+              'xcode_settings': {
+                'WARNING_CFLAGS': [
+                  '-Wno-return-type',
+                ],
+              },
             }],
             ['OS=="mac"', {
               'sources': [
diff --git a/webrtc/api/objc/RTCVideoFrame+Private.h b/webrtc/api/objc/RTCVideoFrame+Private.h
index 954344a..873d3eb 100644
--- a/webrtc/api/objc/RTCVideoFrame+Private.h
+++ b/webrtc/api/objc/RTCVideoFrame+Private.h
@@ -10,7 +10,7 @@
 
 #import "RTCVideoFrame.h"
 
-#include "talk/media/base/videoframe.h"
+#include "webrtc/media/base/videoframe.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
diff --git a/webrtc/api/objc/avfoundationvideocapturer.h b/webrtc/api/objc/avfoundationvideocapturer.h
index 79dec58..2ee456d 100644
--- a/webrtc/api/objc/avfoundationvideocapturer.h
+++ b/webrtc/api/objc/avfoundationvideocapturer.h
@@ -11,8 +11,8 @@
 #ifndef WEBRTC_API_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_
 #define WEBRTC_API_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_
 
-#include "talk/media/base/videocapturer.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/videocapturer.h"
 #include "webrtc/video_frame.h"
 
 #import <AVFoundation/AVFoundation.h>
diff --git a/webrtc/build/common.gypi b/webrtc/build/common.gypi
index d5b79f9..67d5c81 100644
--- a/webrtc/build/common.gypi
+++ b/webrtc/build/common.gypi
@@ -106,6 +106,7 @@
     'build_opus%': 1,
     'build_protobuf%': 1,
     'build_ssl%': 1,
+    'build_usrsctp%': 1,
 
     # Disable by default
     'have_dbus_glib%': 0,
@@ -120,6 +121,9 @@
     # TODO(henrika): add support for Open SL ES.
     'enable_android_opensl%': 0,
 
+    # Disable this to skip building source requiring GTK.
+    'use_gtk%': 1,
+
     # Link-Time Optimizations
     # Executes code generation at link-time instead of compile-time
     # https://gcc.gnu.org/wiki/LinkTimeOptimization
diff --git a/webrtc/build/sanitizers/lsan_suppressions_webrtc.cc b/webrtc/build/sanitizers/lsan_suppressions_webrtc.cc
index 01ded5b42..42b3b14 100644
--- a/webrtc/build/sanitizers/lsan_suppressions_webrtc.cc
+++ b/webrtc/build/sanitizers/lsan_suppressions_webrtc.cc
@@ -70,7 +70,7 @@
 "leak:PubSubClientTest::PubSubClientTest\n"
 "leak:PubSubTasksTest::PubSubTasksTest\n"
 
-// libjingle_media_unittest
+// rtc_media_unittests
 "leak:cricket::FakeNetworkInterface::SetOption\n"
 "leak:CodecTest_TestCodecOperators_Test::TestBody\n"
 "leak:VideoEngineTest*::ConstrainNewCodecBody\n"
diff --git a/webrtc/build/sanitizers/tsan_suppressions_webrtc.cc b/webrtc/build/sanitizers/tsan_suppressions_webrtc.cc
index 1150990..ac27c49 100644
--- a/webrtc/build/sanitizers/tsan_suppressions_webrtc.cc
+++ b/webrtc/build/sanitizers/tsan_suppressions_webrtc.cc
@@ -29,7 +29,7 @@
 "race:vp8cx_remove_encoder_threads\n"
 "race:third_party/libvpx_new/source/libvpx/vp9/common/vp9_scan.h\n"
 
-// Usage of trace callback and trace level is racy in libjingle_media_unittests.
+// Usage of trace callback and trace level is racy in rtc_media_unittests.
 // https://code.google.com/p/webrtc/issues/detail?id=3372
 "race:webrtc::TraceImpl::WriteToFile\n"
 "race:webrtc::VideoEngine::SetTraceFilter\n"
@@ -46,7 +46,7 @@
 // https://code.google.com/p/webrtc/issues/detail?id=5152
 "race:webrtc::AudioDeviceLinuxPulse::Init\n"
 
-// rtc_unittest
+// rtc_unittests
 // https://code.google.com/p/webrtc/issues/detail?id=3911 for details.
 "race:rtc::AsyncInvoker::OnMessage\n"
 "race:rtc::FireAndForgetAsyncClosure<FunctorB>::Execute\n"
diff --git a/webrtc/examples/peerconnection/client/conductor.cc b/webrtc/examples/peerconnection/client/conductor.cc
index 883f44a..3a40fd9 100644
--- a/webrtc/examples/peerconnection/client/conductor.cc
+++ b/webrtc/examples/peerconnection/client/conductor.cc
@@ -13,13 +13,13 @@
 #include <utility>
 #include <vector>
 
-#include "talk/app/webrtc/videosourceinterface.h"
-#include "webrtc/examples/peerconnection/client/defaults.h"
-#include "talk/media/devices/devicemanager.h"
 #include "talk/app/webrtc/test/fakeconstraints.h"
+#include "talk/app/webrtc/videosourceinterface.h"
 #include "webrtc/base/common.h"
 #include "webrtc/base/json.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/examples/peerconnection/client/defaults.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 // Names used for a IceCandidate JSON object.
 const char kCandidateSdpMidName[] = "sdpMid";
diff --git a/webrtc/examples/peerconnection/client/main_wnd.h b/webrtc/examples/peerconnection/client/main_wnd.h
index ac4fd8a..6d39b38 100644
--- a/webrtc/examples/peerconnection/client/main_wnd.h
+++ b/webrtc/examples/peerconnection/client/main_wnd.h
@@ -16,12 +16,12 @@
 #include <string>
 
 #include "talk/app/webrtc/mediastreaminterface.h"
-#include "webrtc/examples/peerconnection/client/peer_connection_client.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/videocommon.h"
-#include "talk/media/base/videoframe.h"
-#include "talk/media/base/videorenderer.h"
 #include "webrtc/base/win32.h"
+#include "webrtc/examples/peerconnection/client/peer_connection_client.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/base/videoframe.h"
+#include "webrtc/media/base/videorenderer.h"
 
 class MainWndCallback {
  public:
diff --git a/webrtc/libjingle_media_unittest.isolate b/webrtc/libjingle_media_unittest.isolate
new file mode 100644
index 0000000..9e3a10d5
--- /dev/null
+++ b/webrtc/libjingle_media_unittest.isolate
@@ -0,0 +1,28 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'conditions': [
+    ['OS=="linux" or OS=="mac" or OS=="win"', {
+      'variables': {
+        'command': [
+          '<(PRODUCT_DIR)/libjingle_media_unittest<(EXECUTABLE_SUFFIX)',
+        ],
+        'files': [
+          '<(PRODUCT_DIR)/libjingle_media_unittest<(EXECUTABLE_SUFFIX)',
+          '<(DEPTH)/resources/media/captured-320x240-2s-48.frames',
+          '<(DEPTH)/resources/media/faces.1280x720_P420.yuv',
+          '<(DEPTH)/resources/media/faces_I420.jpg',
+          '<(DEPTH)/resources/media/faces_I422.jpg',
+          '<(DEPTH)/resources/media/faces_I444.jpg',
+          '<(DEPTH)/resources/media/faces_I411.jpg',
+          '<(DEPTH)/resources/media/faces_I400.jpg',
+        ],
+      },
+    }],
+  ],
+}
diff --git a/talk/media/base/audioframe.h b/webrtc/media/base/audioframe.h
similarity index 94%
rename from talk/media/base/audioframe.h
rename to webrtc/media/base/audioframe.h
index 157d0f1..ad1f7d7 100644
--- a/talk/media/base/audioframe.h
+++ b/webrtc/media/base/audioframe.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_AUDIOFRAME_H_
-#define TALK_MEDIA_BASE_AUDIOFRAME_H_
+#ifndef WEBRTC_MEDIA_BASE_AUDIOFRAME_H_
+#define WEBRTC_MEDIA_BASE_AUDIOFRAME_H_
 
 namespace cricket {
 
@@ -59,4 +59,4 @@
 };
 
 }  // namespace cricket
-#endif  // TALK_MEDIA_BASE_AUDIOFRAME_H_
+#endif  // WEBRTC_MEDIA_BASE_AUDIOFRAME_H_
diff --git a/talk/media/base/audiorenderer.h b/webrtc/media/base/audiorenderer.h
similarity index 94%
rename from talk/media/base/audiorenderer.h
rename to webrtc/media/base/audiorenderer.h
index a42cd7d..626b492 100644
--- a/talk/media/base/audiorenderer.h
+++ b/webrtc/media/base/audiorenderer.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_AUDIORENDERER_H_
-#define TALK_MEDIA_BASE_AUDIORENDERER_H_
+#ifndef WEBRTC_MEDIA_BASE_AUDIORENDERER_H_
+#define WEBRTC_MEDIA_BASE_AUDIORENDERER_H_
 
 #include <cstddef>
 
@@ -61,4 +61,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_AUDIORENDERER_H_
+#endif  // WEBRTC_MEDIA_BASE_AUDIORENDERER_H_
diff --git a/talk/media/base/capturemanager.cc b/webrtc/media/base/capturemanager.cc
similarity index 99%
rename from talk/media/base/capturemanager.cc
rename to webrtc/media/base/capturemanager.cc
index 78ca99d..8111991 100644
--- a/talk/media/base/capturemanager.cc
+++ b/webrtc/media/base/capturemanager.cc
@@ -25,13 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/capturemanager.h"
+#include "webrtc/media/base/capturemanager.h"
 
 #include <algorithm>
 
-#include "talk/media/base/videocapturer.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/base/videocapturer.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/capturemanager.h b/webrtc/media/base/capturemanager.h
similarity index 94%
rename from talk/media/base/capturemanager.h
rename to webrtc/media/base/capturemanager.h
index 9f3c208..4994d6a 100644
--- a/talk/media/base/capturemanager.h
+++ b/webrtc/media/base/capturemanager.h
@@ -38,16 +38,16 @@
 // thread which is normally a separate unmarshalled thread and thus normally
 // require lock protection.
 
-#ifndef TALK_MEDIA_BASE_CAPTUREMANAGER_H_
-#define TALK_MEDIA_BASE_CAPTUREMANAGER_H_
+#ifndef WEBRTC_MEDIA_BASE_CAPTUREMANAGER_H_
+#define WEBRTC_MEDIA_BASE_CAPTUREMANAGER_H_
 
 #include <map>
 #include <vector>
 
-#include "talk/media/base/capturerenderadapter.h"
-#include "talk/media/base/videocommon.h"
 #include "webrtc/base/sigslotrepeater.h"
 #include "webrtc/base/thread_checker.h"
+#include "webrtc/media/base/capturerenderadapter.h"
+#include "webrtc/media/base/videocommon.h"
 
 namespace cricket {
 
@@ -105,4 +105,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_CAPTUREMANAGER_H_
+#endif  // WEBRTC_MEDIA_BASE_CAPTUREMANAGER_H_
diff --git a/talk/media/base/capturemanager_unittest.cc b/webrtc/media/base/capturemanager_unittest.cc
similarity index 97%
rename from talk/media/base/capturemanager_unittest.cc
rename to webrtc/media/base/capturemanager_unittest.cc
index 4a75fc3..02a88b1 100644
--- a/talk/media/base/capturemanager_unittest.cc
+++ b/webrtc/media/base/capturemanager_unittest.cc
@@ -25,13 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/capturemanager.h"
+#include "webrtc/media/base/capturemanager.h"
 
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/fakevideorenderer.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/sigslot.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/fakevideorenderer.h"
 
 const int kMsCallbackWait = 50;
 
@@ -58,7 +58,7 @@
   }
   void PopulateSupportedFormats() {
     std::vector<cricket::VideoFormat> formats;
-    for (int i = 0; i < arraysize(kCameraFormats); ++i) {
+    for (uint32_t i = 0; i < arraysize(kCameraFormats); ++i) {
       formats.push_back(cricket::VideoFormat(kCameraFormats[i]));
     }
     video_capturer_.ResetSupportedFormats(formats);
diff --git a/talk/media/base/capturerenderadapter.cc b/webrtc/media/base/capturerenderadapter.cc
similarity index 95%
rename from talk/media/base/capturerenderadapter.cc
rename to webrtc/media/base/capturerenderadapter.cc
index 87b3c11..31e19fc 100644
--- a/talk/media/base/capturerenderadapter.cc
+++ b/webrtc/media/base/capturerenderadapter.cc
@@ -25,11 +25,11 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/capturerenderadapter.h"
+#include "webrtc/media/base/capturerenderadapter.h"
 
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videorenderer.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videorenderer.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/capturerenderadapter.h b/webrtc/media/base/capturerenderadapter.h
similarity index 93%
rename from talk/media/base/capturerenderadapter.h
rename to webrtc/media/base/capturerenderadapter.h
index f972c98..ed13989 100644
--- a/talk/media/base/capturerenderadapter.h
+++ b/webrtc/media/base/capturerenderadapter.h
@@ -31,14 +31,14 @@
 // CaptureRenderAdapter is Thread-unsafe. This means that none of its APIs may
 // be called concurrently.
 
-#ifndef TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_
-#define TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_
+#ifndef WEBRTC_MEDIA_BASE_CAPTURERENDERADAPTER_H_
+#define WEBRTC_MEDIA_BASE_CAPTURERENDERADAPTER_H_
 
 #include <vector>
 
-#include "talk/media/base/videocapturer.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/sigslot.h"
+#include "webrtc/media/base/videocapturer.h"
 #include "webrtc/media/base/videosinkinterface.h"
 
 namespace cricket {
@@ -72,4 +72,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_
+#endif  // WEBRTC_MEDIA_BASE_CAPTURERENDERADAPTER_H_
diff --git a/talk/media/base/codec.cc b/webrtc/media/base/codec.cc
similarity index 99%
rename from talk/media/base/codec.cc
rename to webrtc/media/base/codec.cc
index 1dd01e4..cdea764 100644
--- a/talk/media/base/codec.cc
+++ b/webrtc/media/base/codec.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/codec.h"
+#include "webrtc/media/base/codec.h"
 
 #include <algorithm>
 #include <sstream>
diff --git a/talk/media/base/codec.h b/webrtc/media/base/codec.h
similarity index 97%
rename from talk/media/base/codec.h
rename to webrtc/media/base/codec.h
index 9d4d81a..b33447b 100644
--- a/talk/media/base/codec.h
+++ b/webrtc/media/base/codec.h
@@ -25,15 +25,15 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_CODEC_H_
-#define TALK_MEDIA_BASE_CODEC_H_
+#ifndef WEBRTC_MEDIA_BASE_CODEC_H_
+#define WEBRTC_MEDIA_BASE_CODEC_H_
 
 #include <map>
 #include <set>
 #include <string>
 #include <vector>
 
-#include "talk/media/base/constants.h"
+#include "webrtc/media/base/constants.h"
 
 namespace cricket {
 
@@ -241,4 +241,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_CODEC_H_
+#endif  // WEBRTC_MEDIA_BASE_CODEC_H_
diff --git a/talk/media/base/codec_unittest.cc b/webrtc/media/base/codec_unittest.cc
similarity index 99%
rename from talk/media/base/codec_unittest.cc
rename to webrtc/media/base/codec_unittest.cc
index b2aff50..8de46cc 100644
--- a/talk/media/base/codec_unittest.cc
+++ b/webrtc/media/base/codec_unittest.cc
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/codec.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/base/codec.h"
 
 using cricket::AudioCodec;
 using cricket::Codec;
diff --git a/talk/media/base/constants.cc b/webrtc/media/base/constants.cc
similarity index 98%
rename from talk/media/base/constants.cc
rename to webrtc/media/base/constants.cc
index 0e630d0..842e733 100644
--- a/talk/media/base/constants.cc
+++ b/webrtc/media/base/constants.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/constants.h"
+#include "webrtc/media/base/constants.h"
 
 #include <string>
 
diff --git a/talk/media/base/constants.h b/webrtc/media/base/constants.h
similarity index 98%
rename from talk/media/base/constants.h
rename to webrtc/media/base/constants.h
index dbab618..d1279f5 100644
--- a/talk/media/base/constants.h
+++ b/webrtc/media/base/constants.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_CONSTANTS_H_
-#define TALK_MEDIA_BASE_CONSTANTS_H_
+#ifndef WEBRTC_MEDIA_BASE_CONSTANTS_H_
+#define WEBRTC_MEDIA_BASE_CONSTANTS_H_
 
 #include <string>
 
@@ -180,4 +180,4 @@
 extern const int kDefaultVideoMaxFramerate;
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_CONSTANTS_H_
+#endif  // WEBRTC_MEDIA_BASE_CONSTANTS_H_
diff --git a/talk/media/base/cpuid.cc b/webrtc/media/base/cpuid.cc
similarity index 98%
rename from talk/media/base/cpuid.cc
rename to webrtc/media/base/cpuid.cc
index daaf94e..6b89cdd 100644
--- a/talk/media/base/cpuid.cc
+++ b/webrtc/media/base/cpuid.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/cpuid.h"
+#include "webrtc/media/base/cpuid.h"
 
 #include "libyuv/cpu_id.h"
 
diff --git a/talk/media/base/cpuid.h b/webrtc/media/base/cpuid.h
similarity index 95%
rename from talk/media/base/cpuid.h
rename to webrtc/media/base/cpuid.h
index d97b28e..64ed311 100644
--- a/talk/media/base/cpuid.h
+++ b/webrtc/media/base/cpuid.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_CPUID_H_
-#define TALK_MEDIA_BASE_CPUID_H_
+#ifndef WEBRTC_MEDIA_BASE_CPUID_H_
+#define WEBRTC_MEDIA_BASE_CPUID_H_
 
 #include "webrtc/base/constructormagic.h"
 
@@ -73,4 +73,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_CPUID_H_
+#endif  // WEBRTC_MEDIA_BASE_CPUID_H_
diff --git a/talk/media/base/cpuid_unittest.cc b/webrtc/media/base/cpuid_unittest.cc
similarity index 98%
rename from talk/media/base/cpuid_unittest.cc
rename to webrtc/media/base/cpuid_unittest.cc
index f03b77f..70ef1fd 100644
--- a/talk/media/base/cpuid_unittest.cc
+++ b/webrtc/media/base/cpuid_unittest.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/cpuid.h"
+#include "webrtc/media/base/cpuid.h"
 
 #include <iostream>
 
diff --git a/talk/media/base/cryptoparams.h b/webrtc/media/base/cryptoparams.h
similarity index 93%
rename from talk/media/base/cryptoparams.h
rename to webrtc/media/base/cryptoparams.h
index 589953d..adba755 100644
--- a/talk/media/base/cryptoparams.h
+++ b/webrtc/media/base/cryptoparams.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_CRYPTOPARAMS_H_
-#define TALK_MEDIA_BASE_CRYPTOPARAMS_H_
+#ifndef WEBRTC_MEDIA_BASE_CRYPTOPARAMS_H_
+#define WEBRTC_MEDIA_BASE_CRYPTOPARAMS_H_
 
 #include <string>
 
@@ -53,4 +53,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_CRYPTOPARAMS_H_
+#endif  // WEBRTC_MEDIA_BASE_CRYPTOPARAMS_H_
diff --git a/talk/media/base/device.h b/webrtc/media/base/device.h
old mode 100755
new mode 100644
similarity index 94%
rename from talk/media/base/device.h
rename to webrtc/media/base/device.h
index 829ee30..06f4324
--- a/talk/media/base/device.h
+++ b/webrtc/media/base/device.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_DEVICE_H_
-#define TALK_MEDIA_BASE_DEVICE_H_
+#ifndef WEBRTC_MEDIA_BASE_DEVICE_H_
+#define WEBRTC_MEDIA_BASE_DEVICE_H_
 
 #include "webrtc/base/stringencode.h"
 
@@ -48,4 +48,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_DEVICE_H_
+#endif  // WEBRTC_MEDIA_BASE_DEVICE_H_
diff --git a/talk/media/base/executablehelpers.h b/webrtc/media/base/executablehelpers.h
similarity index 95%
rename from talk/media/base/executablehelpers.h
rename to webrtc/media/base/executablehelpers.h
index dd165c2..581df57 100644
--- a/talk/media/base/executablehelpers.h
+++ b/webrtc/media/base/executablehelpers.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_EXECUTABLEHELPERS_H_
-#define TALK_MEDIA_BASE_EXECUTABLEHELPERS_H_
+#ifndef WEBRTC_MEDIA_BASE_EXECUTABLEHELPERS_H_
+#define WEBRTC_MEDIA_BASE_EXECUTABLEHELPERS_H_
 
 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
 #include <mach-o/dyld.h>
@@ -96,5 +96,5 @@
 
 }  // namespace rtc
 
-#endif  // TALK_MEDIA_BASE_EXECUTABLEHELPERS_H_
+#endif  // WEBRTC_MEDIA_BASE_EXECUTABLEHELPERS_H_
 
diff --git a/talk/media/base/fakecapturemanager.h b/webrtc/media/base/fakecapturemanager.h
similarity index 90%
rename from talk/media/base/fakecapturemanager.h
rename to webrtc/media/base/fakecapturemanager.h
index 577a033..8af2ed8 100644
--- a/talk/media/base/fakecapturemanager.h
+++ b/webrtc/media/base/fakecapturemanager.h
@@ -25,10 +25,10 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_FAKECAPTUREMANAGER_H_
-#define TALK_MEDIA_BASE_FAKECAPTUREMANAGER_H_
+#ifndef WEBRTC_MEDIA_BASE_FAKECAPTUREMANAGER_H_
+#define WEBRTC_MEDIA_BASE_FAKECAPTUREMANAGER_H_
 
-#include "talk/media/base/capturemanager.h"
+#include "webrtc/media/base/capturemanager.h"
 
 namespace cricket {
 
@@ -45,4 +45,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_FAKECAPTUREMANAGER_H_
+#endif  // WEBRTC_MEDIA_BASE_FAKECAPTUREMANAGER_H_
diff --git a/talk/media/base/fakemediaengine.h b/webrtc/media/base/fakemediaengine.h
similarity index 98%
rename from talk/media/base/fakemediaengine.h
rename to webrtc/media/base/fakemediaengine.h
index 6cd1791..cc65aab 100644
--- a/talk/media/base/fakemediaengine.h
+++ b/webrtc/media/base/fakemediaengine.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_
-#define TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_
+#ifndef WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_
+#define WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_
 
 #include <list>
 #include <map>
@@ -34,13 +34,13 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/audiorenderer.h"
-#include "talk/media/base/mediaengine.h"
-#include "talk/media/base/rtputils.h"
-#include "talk/media/base/streamparams.h"
 #include "webrtc/audio/audio_sink.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/stringutils.h"
+#include "webrtc/media/base/audiorenderer.h"
+#include "webrtc/media/base/mediaengine.h"
+#include "webrtc/media/base/rtputils.h"
+#include "webrtc/media/base/streamparams.h"
 #include "webrtc/p2p/base/sessiondescription.h"
 
 namespace cricket {
@@ -889,4 +889,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_
+#endif  // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_
diff --git a/talk/media/base/fakenetworkinterface.h b/webrtc/media/base/fakenetworkinterface.h
similarity index 96%
rename from talk/media/base/fakenetworkinterface.h
rename to webrtc/media/base/fakenetworkinterface.h
index 418dfef..3ff0703 100644
--- a/talk/media/base/fakenetworkinterface.h
+++ b/webrtc/media/base/fakenetworkinterface.h
@@ -25,14 +25,12 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_FAKENETWORKINTERFACE_H_
-#define TALK_MEDIA_BASE_FAKENETWORKINTERFACE_H_
+#ifndef WEBRTC_MEDIA_BASE_FAKENETWORKINTERFACE_H_
+#define WEBRTC_MEDIA_BASE_FAKENETWORKINTERFACE_H_
 
 #include <map>
 #include <vector>
 
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/rtputils.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/byteorder.h"
 #include "webrtc/base/criticalsection.h"
@@ -40,6 +38,8 @@
 #include "webrtc/base/messagehandler.h"
 #include "webrtc/base/messagequeue.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/rtputils.h"
 
 namespace cricket {
 
@@ -242,4 +242,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_FAKENETWORKINTERFACE_H_
+#endif  // WEBRTC_MEDIA_BASE_FAKENETWORKINTERFACE_H_
diff --git a/talk/media/base/fakertp.h b/webrtc/media/base/fakertp.h
similarity index 97%
rename from talk/media/base/fakertp.h
rename to webrtc/media/base/fakertp.h
index 7c56cba..229d5cb 100644
--- a/talk/media/base/fakertp.h
+++ b/webrtc/media/base/fakertp.h
@@ -27,8 +27,8 @@
 
 // Fake RTP and RTCP packets to use in unit tests.
 
-#ifndef TALK_MEDIA_BASE_FAKERTP_H_
-#define TALK_MEDIA_BASE_FAKERTP_H_
+#ifndef WEBRTC_MEDIA_BASE_FAKERTP_H_
+#define WEBRTC_MEDIA_BASE_FAKERTP_H_
 
 // A typical PCMU RTP packet.
 // PT=0, SN=1, TS=0, SSRC=1
@@ -101,4 +101,4 @@
   0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
 };
 
-#endif  // TALK_MEDIA_BASE_FAKERTP_H_
+#endif  // WEBRTC_MEDIA_BASE_FAKERTP_H_
diff --git a/talk/media/base/fakescreencapturerfactory.h b/webrtc/media/base/fakescreencapturerfactory.h
old mode 100755
new mode 100644
similarity index 90%
rename from talk/media/base/fakescreencapturerfactory.h
rename to webrtc/media/base/fakescreencapturerfactory.h
index dfd7376..c4995da
--- a/talk/media/base/fakescreencapturerfactory.h
+++ b/webrtc/media/base/fakescreencapturerfactory.h
@@ -25,11 +25,11 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_FAKESCREENCAPTURERFACTORY_H_
-#define TALK_MEDIA_BASE_FAKESCREENCAPTURERFACTORY_H_
+#ifndef WEBRTC_MEDIA_BASE_FAKESCREENCAPTURERFACTORY_H_
+#define WEBRTC_MEDIA_BASE_FAKESCREENCAPTURERFACTORY_H_
 
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/videocapturerfactory.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/videocapturerfactory.h"
 
 namespace cricket {
 
@@ -75,4 +75,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_FAKESCREENCAPTURERFACTORY_H_
+#endif  // WEBRTC_MEDIA_BASE_FAKESCREENCAPTURERFACTORY_H_
diff --git a/talk/media/base/fakevideocapturer.h b/webrtc/media/base/fakevideocapturer.h
similarity index 94%
rename from talk/media/base/fakevideocapturer.h
rename to webrtc/media/base/fakevideocapturer.h
index a668ea7..ed70e27 100644
--- a/talk/media/base/fakevideocapturer.h
+++ b/webrtc/media/base/fakevideocapturer.h
@@ -25,19 +25,19 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
-#define TALK_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
+#ifndef WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
+#define WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
 
 #include <string.h>
 
 #include <vector>
 
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videocommon.h"
-#include "talk/media/base/videoframe.h"
 #include "webrtc/base/timeutils.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/base/videoframe.h"
 #ifdef HAVE_WEBRTC_VIDEO
-#include "talk/media/webrtc/webrtcvideoframefactory.h"
+#include "webrtc/media/webrtc/webrtcvideoframefactory.h"
 #endif
 
 namespace cricket {
@@ -179,4 +179,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
+#endif  // WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_
diff --git a/talk/media/base/fakevideorenderer.h b/webrtc/media/base/fakevideorenderer.h
similarity index 95%
rename from talk/media/base/fakevideorenderer.h
rename to webrtc/media/base/fakevideorenderer.h
index 0abfeff..7a8ec33 100644
--- a/talk/media/base/fakevideorenderer.h
+++ b/webrtc/media/base/fakevideorenderer.h
@@ -25,13 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_FAKEVIDEORENDERER_H_
-#define TALK_MEDIA_BASE_FAKEVIDEORENDERER_H_
+#ifndef WEBRTC_MEDIA_BASE_FAKEVIDEORENDERER_H_
+#define WEBRTC_MEDIA_BASE_FAKEVIDEORENDERER_H_
 
-#include "talk/media/base/videoframe.h"
-#include "talk/media/base/videorenderer.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/sigslot.h"
+#include "webrtc/media/base/videoframe.h"
+#include "webrtc/media/base/videorenderer.h"
 
 namespace cricket {
 
@@ -147,4 +147,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_FAKEVIDEORENDERER_H_
+#endif  // WEBRTC_MEDIA_BASE_FAKEVIDEORENDERER_H_
diff --git a/talk/media/base/hybriddataengine.h b/webrtc/media/base/hybriddataengine.h
similarity index 88%
rename from talk/media/base/hybriddataengine.h
rename to webrtc/media/base/hybriddataengine.h
index cbdfa8a..a5b09a1 100644
--- a/talk/media/base/hybriddataengine.h
+++ b/webrtc/media/base/hybriddataengine.h
@@ -1,6 +1,6 @@
 /*
  * libjingle
- * Copyright 2012 Google Inc. and Robin Seggelmann
+ * Copyright 2012 Google Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -25,16 +25,16 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_SCTP_HYBRIDDATAENGINE_H_
-#define TALK_MEDIA_SCTP_HYBRIDDATAENGINE_H_
+#ifndef WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
+#define WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/base/codec.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/mediaengine.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/mediaengine.h"
 
 namespace cricket {
 
@@ -73,4 +73,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_SCTP_HYBRIDDATAENGINE_H_
+#endif  // WEBRTC_MEDIA_BASE_HYBRIDDATAENGINE_H_
diff --git a/talk/media/base/mediachannel.h b/webrtc/media/base/mediachannel.h
similarity index 99%
rename from talk/media/base/mediachannel.h
rename to webrtc/media/base/mediachannel.h
index b72af4d..30d4a45 100644
--- a/talk/media/base/mediachannel.h
+++ b/webrtc/media/base/mediachannel.h
@@ -25,15 +25,12 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_MEDIACHANNEL_H_
-#define TALK_MEDIA_BASE_MEDIACHANNEL_H_
+#ifndef WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
+#define WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/base/codec.h"
-#include "talk/media/base/constants.h"
-#include "talk/media/base/streamparams.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/dscp.h"
@@ -42,6 +39,9 @@
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/socket.h"
 #include "webrtc/base/window.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/streamparams.h"
 #include "webrtc/media/base/videosinkinterface.h"
 // TODO(juberti): re-evaluate this include
 #include "talk/session/media/audiomonitor.h"
@@ -1134,4 +1134,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_MEDIACHANNEL_H_
+#endif  // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
diff --git a/talk/media/base/mediacommon.h b/webrtc/media/base/mediacommon.h
similarity index 92%
rename from talk/media/base/mediacommon.h
rename to webrtc/media/base/mediacommon.h
index 6eb5457..b3f1912 100644
--- a/talk/media/base/mediacommon.h
+++ b/webrtc/media/base/mediacommon.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_MEDIACOMMON_H_
-#define TALK_MEDIA_BASE_MEDIACOMMON_H_
+#ifndef WEBRTC_MEDIA_BASE_MEDIACOMMON_H_
+#define WEBRTC_MEDIA_BASE_MEDIACOMMON_H_
 
 #include "webrtc/base/stringencode.h"
 
@@ -41,4 +41,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_MEDIACOMMON_H_
+#endif  // WEBRTC_MEDIA_BASE_MEDIACOMMON_H_
diff --git a/talk/media/base/mediaengine.cc b/webrtc/media/base/mediaengine.cc
similarity index 95%
rename from talk/media/base/mediaengine.cc
rename to webrtc/media/base/mediaengine.cc
index 9be590c..32d6d92 100644
--- a/talk/media/base/mediaengine.cc
+++ b/webrtc/media/base/mediaengine.cc
@@ -25,12 +25,12 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/mediaengine.h"
+#include "webrtc/media/base/mediaengine.h"
 
 #if !defined(DISABLE_MEDIA_ENGINE_FACTORY)
 
 #if defined(HAVE_WEBRTC_VOICE) && defined(HAVE_WEBRTC_VIDEO)
-#include "talk/media/webrtc/webrtcmediaengine.h"
+#include "webrtc/media/webrtc/webrtcmediaengine.h"
 #endif  // HAVE_WEBRTC_VOICE && HAVE_WEBRTC_VIDEO
 
 #ifdef HAVE_CONFIG_H
diff --git a/talk/media/base/mediaengine.h b/webrtc/media/base/mediaengine.h
similarity index 94%
rename from talk/media/base/mediaengine.h
rename to webrtc/media/base/mediaengine.h
index 3f7eec2..017e7b6 100644
--- a/talk/media/base/mediaengine.h
+++ b/webrtc/media/base/mediaengine.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_MEDIAENGINE_H_
-#define TALK_MEDIA_BASE_MEDIAENGINE_H_
+#ifndef WEBRTC_MEDIA_BASE_MEDIAENGINE_H_
+#define WEBRTC_MEDIA_BASE_MEDIAENGINE_H_
 
 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
 #include <CoreAudio/CoreAudio.h>
@@ -35,15 +35,15 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/codec.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/mediacommon.h"
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videocommon.h"
-#include "talk/media/devices/devicemanager.h"
 #include "webrtc/audio_state.h"
 #include "webrtc/base/fileutils.h"
 #include "webrtc/base/sigslotrepeater.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/mediacommon.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 #if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD)
 #define DISABLE_MEDIA_ENGINE_FACTORY
@@ -221,4 +221,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_MEDIAENGINE_H_
+#endif  // WEBRTC_MEDIA_BASE_MEDIAENGINE_H_
diff --git a/talk/media/base/mutedvideocapturer.cc b/webrtc/media/base/mutedvideocapturer.cc
similarity index 100%
rename from talk/media/base/mutedvideocapturer.cc
rename to webrtc/media/base/mutedvideocapturer.cc
diff --git a/talk/media/base/rtpdataengine.cc b/webrtc/media/base/rtpdataengine.cc
similarity index 97%
rename from talk/media/base/rtpdataengine.cc
rename to webrtc/media/base/rtpdataengine.cc
index 9b26280..df104f6 100644
--- a/talk/media/base/rtpdataengine.cc
+++ b/webrtc/media/base/rtpdataengine.cc
@@ -25,17 +25,17 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/rtpdataengine.h"
+#include "webrtc/media/base/rtpdataengine.h"
 
-#include "talk/media/base/codec.h"
-#include "talk/media/base/constants.h"
-#include "talk/media/base/rtputils.h"
-#include "talk/media/base/streamparams.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/helpers.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/ratelimiter.h"
 #include "webrtc/base/timing.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/rtputils.h"
+#include "webrtc/media/base/streamparams.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/rtpdataengine.h b/webrtc/media/base/rtpdataengine.h
similarity index 94%
rename from talk/media/base/rtpdataengine.h
rename to webrtc/media/base/rtpdataengine.h
index c0449c9..72f7fb7 100644
--- a/talk/media/base/rtpdataengine.h
+++ b/webrtc/media/base/rtpdataengine.h
@@ -25,16 +25,16 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_RTPDATAENGINE_H_
-#define TALK_MEDIA_BASE_RTPDATAENGINE_H_
+#ifndef WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_
+#define WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/base/constants.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/mediaengine.h"
 #include "webrtc/base/timing.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/mediaengine.h"
 
 namespace cricket {
 
@@ -138,4 +138,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_RTPDATAENGINE_H_
+#endif  // WEBRTC_MEDIA_BASE_RTPDATAENGINE_H_
diff --git a/talk/media/base/rtpdataengine_unittest.cc b/webrtc/media/base/rtpdataengine_unittest.cc
similarity index 98%
rename from talk/media/base/rtpdataengine_unittest.cc
rename to webrtc/media/base/rtpdataengine_unittest.cc
index 38cc2c6..bcd0f14 100644
--- a/talk/media/base/rtpdataengine_unittest.cc
+++ b/webrtc/media/base/rtpdataengine_unittest.cc
@@ -27,16 +27,16 @@
 
 #include <string>
 
-#include "talk/media/base/constants.h"
-#include "talk/media/base/fakenetworkinterface.h"
-#include "talk/media/base/rtpdataengine.h"
-#include "talk/media/base/rtputils.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/helpers.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/ssladapter.h"
 #include "webrtc/base/timing.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/fakenetworkinterface.h"
+#include "webrtc/media/base/rtpdataengine.h"
+#include "webrtc/media/base/rtputils.h"
 
 class FakeTiming : public rtc::Timing {
  public:
diff --git a/talk/media/base/rtpdump.cc b/webrtc/media/base/rtpdump.cc
similarity index 99%
rename from talk/media/base/rtpdump.cc
rename to webrtc/media/base/rtpdump.cc
index 6861636..75e3367 100644
--- a/talk/media/base/rtpdump.cc
+++ b/webrtc/media/base/rtpdump.cc
@@ -25,16 +25,16 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/rtpdump.h"
+#include "webrtc/media/base/rtpdump.h"
 
 #include <ctype.h>
 
 #include <string>
 
-#include "talk/media/base/rtputils.h"
 #include "webrtc/base/byteorder.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/timeutils.h"
+#include "webrtc/media/base/rtputils.h"
 
 namespace {
 static const int kRtpSsrcOffset = 8;
diff --git a/talk/media/base/rtpdump.h b/webrtc/media/base/rtpdump.h
similarity index 98%
rename from talk/media/base/rtpdump.h
rename to webrtc/media/base/rtpdump.h
index 0f3091a..4263edc 100644
--- a/talk/media/base/rtpdump.h
+++ b/webrtc/media/base/rtpdump.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_RTPDUMP_H_
-#define TALK_MEDIA_BASE_RTPDUMP_H_
+#ifndef WEBRTC_MEDIA_BASE_RTPDUMP_H_
+#define WEBRTC_MEDIA_BASE_RTPDUMP_H_
 
 #include <string.h>
 
@@ -231,4 +231,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_RTPDUMP_H_
+#endif  // WEBRTC_MEDIA_BASE_RTPDUMP_H_
diff --git a/talk/media/base/rtpdump_unittest.cc b/webrtc/media/base/rtpdump_unittest.cc
similarity index 98%
rename from talk/media/base/rtpdump_unittest.cc
rename to webrtc/media/base/rtpdump_unittest.cc
index 6366243..820dc31 100644
--- a/talk/media/base/rtpdump_unittest.cc
+++ b/webrtc/media/base/rtpdump_unittest.cc
@@ -27,12 +27,12 @@
 
 #include <string>
 
-#include "talk/media/base/rtpdump.h"
-#include "talk/media/base/rtputils.h"
-#include "talk/media/base/testutils.h"
 #include "webrtc/base/bytebuffer.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/rtpdump.h"
+#include "webrtc/media/base/rtputils.h"
+#include "webrtc/media/base/testutils.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/rtputils.cc b/webrtc/media/base/rtputils.cc
similarity index 99%
rename from talk/media/base/rtputils.cc
rename to webrtc/media/base/rtputils.cc
index 422a858..a3c2504 100644
--- a/talk/media/base/rtputils.cc
+++ b/webrtc/media/base/rtputils.cc
@@ -25,14 +25,14 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/rtputils.h"
+#include "webrtc/media/base/rtputils.h"
 
-#include "talk/media/base/turnutils.h"
 // PacketTimeUpdateParams is defined in asyncpacketsocket.h.
 // TODO(sergeyu): Find more appropriate place for PacketTimeUpdateParams.
 #include "webrtc/base/asyncpacketsocket.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/messagedigest.h"
+#include "webrtc/media/base/turnutils.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/rtputils.h b/webrtc/media/base/rtputils.h
similarity index 96%
rename from talk/media/base/rtputils.h
rename to webrtc/media/base/rtputils.h
index a00b5ef..aefd2c6 100644
--- a/talk/media/base/rtputils.h
+++ b/webrtc/media/base/rtputils.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_RTPUTILS_H_
-#define TALK_MEDIA_BASE_RTPUTILS_H_
+#ifndef WEBRTC_MEDIA_BASE_RTPUTILS_H_
+#define WEBRTC_MEDIA_BASE_RTPUTILS_H_
 
 #include "webrtc/base/byteorder.h"
 
@@ -96,4 +96,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_RTPUTILS_H_
+#endif  // WEBRTC_MEDIA_BASE_RTPUTILS_H_
diff --git a/talk/media/base/rtputils_unittest.cc b/webrtc/media/base/rtputils_unittest.cc
similarity index 99%
rename from talk/media/base/rtputils_unittest.cc
rename to webrtc/media/base/rtputils_unittest.cc
index 4deda7d..d065512 100644
--- a/talk/media/base/rtputils_unittest.cc
+++ b/webrtc/media/base/rtputils_unittest.cc
@@ -25,10 +25,10 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/fakertp.h"
-#include "talk/media/base/rtputils.h"
 #include "webrtc/base/asyncpacketsocket.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/base/fakertp.h"
+#include "webrtc/media/base/rtputils.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/screencastid.h b/webrtc/media/base/screencastid.h
similarity index 96%
rename from talk/media/base/screencastid.h
rename to webrtc/media/base/screencastid.h
index e5115a4..b6a7823 100644
--- a/talk/media/base/screencastid.h
+++ b/webrtc/media/base/screencastid.h
@@ -29,8 +29,8 @@
 //
 // Defines variant class ScreencastId that combines WindowId and DesktopId.
 
-#ifndef TALK_MEDIA_BASE_SCREENCASTID_H_
-#define TALK_MEDIA_BASE_SCREENCASTID_H_
+#ifndef WEBRTC_MEDIA_BASE_SCREENCASTID_H_
+#define WEBRTC_MEDIA_BASE_SCREENCASTID_H_
 
 #include <string>
 #include <vector>
@@ -111,4 +111,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_SCREENCASTID_H_
+#endif  // WEBRTC_MEDIA_BASE_SCREENCASTID_H_
diff --git a/talk/media/base/streamparams.cc b/webrtc/media/base/streamparams.cc
similarity index 99%
rename from talk/media/base/streamparams.cc
rename to webrtc/media/base/streamparams.cc
index 2a1e763..cc3bcd2 100644
--- a/talk/media/base/streamparams.cc
+++ b/webrtc/media/base/streamparams.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/streamparams.h"
+#include "webrtc/media/base/streamparams.h"
 
 #include <list>
 #include <sstream>
diff --git a/talk/media/base/streamparams.h b/webrtc/media/base/streamparams.h
similarity index 98%
rename from talk/media/base/streamparams.h
rename to webrtc/media/base/streamparams.h
index db5f78c..2ceb141 100644
--- a/talk/media/base/streamparams.h
+++ b/webrtc/media/base/streamparams.h
@@ -40,8 +40,8 @@
 // ssrc_groups = {{SIM,{10,20,30}, {FEC,{10,11}, {FEC, {20,21}, {FEC {30,31}}}
 // Please see RFC 5576.
 
-#ifndef TALK_MEDIA_BASE_STREAMPARAMS_H_
-#define TALK_MEDIA_BASE_STREAMPARAMS_H_
+#ifndef WEBRTC_MEDIA_BASE_STREAMPARAMS_H_
+#define WEBRTC_MEDIA_BASE_STREAMPARAMS_H_
 
 #include <algorithm>
 #include <set>
@@ -317,4 +317,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_STREAMPARAMS_H_
+#endif  // WEBRTC_MEDIA_BASE_STREAMPARAMS_H_
diff --git a/talk/media/base/streamparams_unittest.cc b/webrtc/media/base/streamparams_unittest.cc
similarity index 98%
rename from talk/media/base/streamparams_unittest.cc
rename to webrtc/media/base/streamparams_unittest.cc
index a016473..f7182b32 100644
--- a/talk/media/base/streamparams_unittest.cc
+++ b/webrtc/media/base/streamparams_unittest.cc
@@ -25,10 +25,10 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/streamparams.h"
-#include "talk/media/base/testutils.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/base/streamparams.h"
+#include "webrtc/media/base/testutils.h"
 
 static const uint32_t kSsrcs1[] = {1};
 static const uint32_t kSsrcs2[] = {1, 2};
@@ -269,7 +269,7 @@
   cricket::StreamParams stream2;
   stream2.add_ssrc(13);
   EXPECT_TRUE(stream2.AddFidSsrc(13, 14));
-  std::remove(stream2.ssrcs.begin(), stream2.ssrcs.end(), 13);
+  std::remove(stream2.ssrcs.begin(), stream2.ssrcs.end(), 13u);
   EXPECT_FALSE(cricket::IsSimulcastStream(stream2));
 
   // stream3 has two SIM groups.
diff --git a/talk/media/base/testutils.cc b/webrtc/media/base/testutils.cc
similarity index 97%
rename from talk/media/base/testutils.cc
rename to webrtc/media/base/testutils.cc
index 49a78e6..683b5cf 100644
--- a/talk/media/base/testutils.cc
+++ b/webrtc/media/base/testutils.cc
@@ -25,15 +25,11 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/testutils.h"
+#include "webrtc/media/base/testutils.h"
 
 #include <math.h>
 #include <algorithm>
 
-#include "talk/media/base/executablehelpers.h"
-#include "talk/media/base/rtpdump.h"
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videoframe.h"
 #include "webrtc/base/bytebuffer.h"
 #include "webrtc/base/fileutils.h"
 #include "webrtc/base/gunit.h"
@@ -41,6 +37,10 @@
 #include "webrtc/base/stream.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/base/testutils.h"
+#include "webrtc/media/base/executablehelpers.h"
+#include "webrtc/media/base/rtpdump.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videoframe.h"
 
 namespace cricket {
 
@@ -258,18 +258,18 @@
   }
 }
 
-// Returns the absolute path to a file in the testdata/ directory.
+// Returns the absolute path to a file in the resources/ directory.
 std::string GetTestFilePath(const std::string& filename) {
   // Locate test data directory.
 #ifdef ENABLE_WEBRTC
   rtc::Pathname path = rtc::GetExecutablePath();
   EXPECT_FALSE(path.empty());
-  path.AppendPathname("../../talk/");
+  path.AppendPathname("../../resources/");
 #else
   rtc::Pathname path = testing::GetTalkDirectory();
   EXPECT_FALSE(path.empty());  // must be run from inside "talk"
 #endif
-  path.AppendFolder("media/testdata/");
+  path.AppendFolder("media/");
   path.SetFilename(filename);
   return path.pathname();
 }
diff --git a/talk/media/base/testutils.h b/webrtc/media/base/testutils.h
similarity index 96%
rename from talk/media/base/testutils.h
rename to webrtc/media/base/testutils.h
index 20c0d62..c894f7f 100644
--- a/talk/media/base/testutils.h
+++ b/webrtc/media/base/testutils.h
@@ -25,20 +25,20 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_TESTUTILS_H_
-#define TALK_MEDIA_BASE_TESTUTILS_H_
+#ifndef WEBRTC_MEDIA_BASE_TESTUTILS_H_
+#define WEBRTC_MEDIA_BASE_TESTUTILS_H_
 
 #include <string>
 #include <vector>
 
 #include "libyuv/compare.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videocommon.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/window.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videocommon.h"
 
 namespace rtc {
 class ByteBuffer;
@@ -246,4 +246,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_TESTUTILS_H_
+#endif  // WEBRTC_MEDIA_BASE_TESTUTILS_H_
diff --git a/talk/media/base/turnutils.cc b/webrtc/media/base/turnutils.cc
similarity index 98%
rename from talk/media/base/turnutils.cc
rename to webrtc/media/base/turnutils.cc
index 038c85c..d4adc4b 100644
--- a/talk/media/base/turnutils.cc
+++ b/webrtc/media/base/turnutils.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/turnutils.h"
+#include "webrtc/media/base/turnutils.h"
 
 #include "webrtc/base/byteorder.h"
 #include "webrtc/base/checks.h"
diff --git a/talk/media/base/turnutils.h b/webrtc/media/base/turnutils.h
similarity index 93%
rename from talk/media/base/turnutils.h
rename to webrtc/media/base/turnutils.h
index 47fcebe..da336ca 100644
--- a/talk/media/base/turnutils.h
+++ b/webrtc/media/base/turnutils.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_TURNUTILS_H_
-#define TALK_MEDIA_BASE_TURNUTILS_H_
+#ifndef WEBRTC_MEDIA_BASE_TURNUTILS_H_
+#define WEBRTC_MEDIA_BASE_TURNUTILS_H_
 
 #include <cstddef>
 #include <cstdint>
@@ -44,4 +44,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_TURNUTILS_H_
+#endif  // WEBRTC_MEDIA_BASE_TURNUTILS_H_
diff --git a/talk/media/base/turnutils_unittest.cc b/webrtc/media/base/turnutils_unittest.cc
similarity index 98%
rename from talk/media/base/turnutils_unittest.cc
rename to webrtc/media/base/turnutils_unittest.cc
index 921c1b8..7bf7e89 100644
--- a/talk/media/base/turnutils_unittest.cc
+++ b/webrtc/media/base/turnutils_unittest.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/turnutils.h"
+#include "webrtc/media/base/turnutils.h"
 
 #include <stddef.h>
 
diff --git a/talk/media/base/videoadapter.cc b/webrtc/media/base/videoadapter.cc
similarity index 98%
rename from talk/media/base/videoadapter.cc
rename to webrtc/media/base/videoadapter.cc
index edeed63..89a4493 100644
--- a/talk/media/base/videoadapter.cc
+++ b/webrtc/media/base/videoadapter.cc
@@ -25,16 +25,16 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/videoadapter.h"
+#include "webrtc/media/base/videoadapter.h"
 
 #include <limits.h>  // For INT_MAX
 #include <algorithm>
 
-#include "talk/media/base/constants.h"
-#include "talk/media/base/videocommon.h"
-#include "talk/media/base/videoframe.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/timeutils.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/base/videoframe.h"
 
 namespace cricket {
 
@@ -303,8 +303,8 @@
 
   const float scale = VideoAdapter::FindClosestViewScale(
       in_width, in_height, output_num_pixels_);
-  const int output_width = static_cast<int>(in_width * scale + .5f);
-  const int output_height = static_cast<int>(in_height * scale + .5f);
+  const size_t output_width = static_cast<size_t>(in_width * scale + .5f);
+  const size_t output_height = static_cast<size_t>(in_height * scale + .5f);
 
   ++frames_out_;
   if (scale != 1)
diff --git a/talk/media/base/videoadapter.h b/webrtc/media/base/videoadapter.h
similarity index 97%
rename from talk/media/base/videoadapter.h
rename to webrtc/media/base/videoadapter.h
index 212f250..cf9a3d1 100644
--- a/talk/media/base/videoadapter.h
+++ b/webrtc/media/base/videoadapter.h
@@ -25,14 +25,14 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_VIDEOADAPTER_H_  // NOLINT
-#define TALK_MEDIA_BASE_VIDEOADAPTER_H_
+#ifndef WEBRTC_MEDIA_BASE_VIDEOADAPTER_H_  // NOLINT
+#define WEBRTC_MEDIA_BASE_VIDEOADAPTER_H_
 
-#include "talk/media/base/videocommon.h"
 #include "webrtc/base/common.h"  // For ASSERT
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/sigslot.h"
+#include "webrtc/media/base/videocommon.h"
 
 namespace cricket {
 
@@ -206,4 +206,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_VIDEOADAPTER_H_  // NOLINT
+#endif  // WEBRTC_MEDIA_BASE_VIDEOADAPTER_H_  // NOLINT
diff --git a/talk/media/base/videoadapter_unittest.cc b/webrtc/media/base/videoadapter_unittest.cc
similarity index 99%
rename from talk/media/base/videoadapter_unittest.cc
rename to webrtc/media/base/videoadapter_unittest.cc
index a8d243e..476d833 100644
--- a/talk/media/base/videoadapter_unittest.cc
+++ b/webrtc/media/base/videoadapter_unittest.cc
@@ -31,13 +31,13 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/testutils.h"
-#include "talk/media/base/videoadapter.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/sigslot.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/base/videoadapter.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/videocapturer.cc b/webrtc/media/base/videocapturer.cc
similarity index 98%
rename from talk/media/base/videocapturer.cc
rename to webrtc/media/base/videocapturer.cc
index d525a41..42b5a4f 100644
--- a/talk/media/base/videocapturer.cc
+++ b/webrtc/media/base/videocapturer.cc
@@ -27,19 +27,19 @@
 
 // Implementation file of class VideoCapturer.
 
-#include "talk/media/base/videocapturer.h"
+#include "webrtc/media/base/videocapturer.h"
 
 #include <algorithm>
 
 #include "libyuv/scale_argb.h"
-#include "talk/media/base/videoframefactory.h"
 #include "webrtc/base/common.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/systeminfo.h"
+#include "webrtc/media/base/videoframefactory.h"
 
 #if defined(HAVE_WEBRTC_VIDEO)
-#include "talk/media/webrtc/webrtcvideoframe.h"
-#include "talk/media/webrtc/webrtcvideoframefactory.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
+#include "webrtc/media/webrtc/webrtcvideoframefactory.h"
 #endif  // HAVE_WEBRTC_VIDEO
 
 namespace cricket {
diff --git a/talk/media/base/videocapturer.h b/webrtc/media/base/videocapturer.h
similarity index 97%
rename from talk/media/base/videocapturer.h
rename to webrtc/media/base/videocapturer.h
index a13c201..1091cf8 100644
--- a/talk/media/base/videocapturer.h
+++ b/webrtc/media/base/videocapturer.h
@@ -27,18 +27,13 @@
 
 // Declaration of abstract class VideoCapturer
 
-#ifndef TALK_MEDIA_BASE_VIDEOCAPTURER_H_
-#define TALK_MEDIA_BASE_VIDEOCAPTURER_H_
+#ifndef WEBRTC_MEDIA_BASE_VIDEOCAPTURER_H_
+#define WEBRTC_MEDIA_BASE_VIDEOCAPTURER_H_
 
 #include <algorithm>
 #include <string>
 #include <vector>
 
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/videoadapter.h"
-#include "talk/media/base/videocommon.h"
-#include "talk/media/base/videoframefactory.h"
-#include "talk/media/devices/devicemanager.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/messagehandler.h"
@@ -47,6 +42,11 @@
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/thread.h"
 #include "webrtc/base/timing.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/videoadapter.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/base/videoframefactory.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 
 namespace cricket {
@@ -382,4 +382,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_VIDEOCAPTURER_H_
+#endif  // WEBRTC_MEDIA_BASE_VIDEOCAPTURER_H_
diff --git a/talk/media/base/videocapturer_unittest.cc b/webrtc/media/base/videocapturer_unittest.cc
similarity index 99%
rename from talk/media/base/videocapturer_unittest.cc
rename to webrtc/media/base/videocapturer_unittest.cc
index bb8eafa..f6597b3 100644
--- a/talk/media/base/videocapturer_unittest.cc
+++ b/webrtc/media/base/videocapturer_unittest.cc
@@ -28,13 +28,13 @@
 #include <stdio.h>
 #include <vector>
 
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/fakevideorenderer.h"
-#include "talk/media/base/testutils.h"
-#include "talk/media/base/videocapturer.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/fakevideorenderer.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/base/videocapturer.h"
 
 using cricket::FakeVideoCapturer;
 
diff --git a/talk/media/base/videocapturerfactory.h b/webrtc/media/base/videocapturerfactory.h
old mode 100755
new mode 100644
similarity index 88%
rename from talk/media/base/videocapturerfactory.h
rename to webrtc/media/base/videocapturerfactory.h
index 6cb629a..e5a98a0
--- a/talk/media/base/videocapturerfactory.h
+++ b/webrtc/media/base/videocapturerfactory.h
@@ -25,11 +25,11 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_VIDEOCAPTURERFACTORY_H_
-#define TALK_MEDIA_BASE_VIDEOCAPTURERFACTORY_H_
+#ifndef WEBRTC_MEDIA_BASE_VIDEOCAPTURERFACTORY_H_
+#define WEBRTC_MEDIA_BASE_VIDEOCAPTURERFACTORY_H_
 
-#include "talk/media/base/device.h"
-#include "talk/media/base/screencastid.h"
+#include "webrtc/media/base/device.h"
+#include "webrtc/media/base/screencastid.h"
 
 namespace cricket {
 
@@ -53,4 +53,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_VIDEOCAPTURERFACTORY_H_
+#endif  // WEBRTC_MEDIA_BASE_VIDEOCAPTURERFACTORY_H_
diff --git a/talk/media/base/videocommon.cc b/webrtc/media/base/videocommon.cc
similarity index 98%
rename from talk/media/base/videocommon.cc
rename to webrtc/media/base/videocommon.cc
index faf6450..d8cecd4 100644
--- a/talk/media/base/videocommon.cc
+++ b/webrtc/media/base/videocommon.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/videocommon.h"
+#include "webrtc/media/base/videocommon.h"
 
 #include <limits.h>  // For INT_MAX
 #include <math.h>
@@ -59,7 +59,7 @@
 };
 
 uint32_t CanonicalFourCC(uint32_t fourcc) {
-  for (int i = 0; i < arraysize(kFourCCAliases); ++i) {
+  for (uint32_t i = 0; i < arraysize(kFourCCAliases); ++i) {
     if (kFourCCAliases[i].alias == fourcc) {
       return kFourCCAliases[i].canonical;
     }
diff --git a/talk/media/base/videocommon.h b/webrtc/media/base/videocommon.h
similarity index 98%
rename from talk/media/base/videocommon.h
rename to webrtc/media/base/videocommon.h
index c28a07b..a2a1e4f 100644
--- a/talk/media/base/videocommon.h
+++ b/webrtc/media/base/videocommon.h
@@ -27,8 +27,8 @@
 
 // Common definition for video, including fourcc and VideoFormat.
 
-#ifndef TALK_MEDIA_BASE_VIDEOCOMMON_H_  // NOLINT
-#define TALK_MEDIA_BASE_VIDEOCOMMON_H_
+#ifndef WEBRTC_MEDIA_BASE_VIDEOCOMMON_H_  // NOLINT
+#define WEBRTC_MEDIA_BASE_VIDEOCOMMON_H_
 
 #include <string>
 
@@ -267,4 +267,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_VIDEOCOMMON_H_  // NOLINT
+#endif  // WEBRTC_MEDIA_BASE_VIDEOCOMMON_H_  // NOLINT
diff --git a/talk/media/base/videocommon_unittest.cc b/webrtc/media/base/videocommon_unittest.cc
similarity index 99%
rename from talk/media/base/videocommon_unittest.cc
rename to webrtc/media/base/videocommon_unittest.cc
index daa9881..6ed643b 100644
--- a/talk/media/base/videocommon_unittest.cc
+++ b/webrtc/media/base/videocommon_unittest.cc
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/videocommon.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/base/videocommon.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/videoengine_unittest.h b/webrtc/media/base/videoengine_unittest.h
similarity index 98%
rename from talk/media/base/videoengine_unittest.h
rename to webrtc/media/base/videoengine_unittest.h
index e3d521d..1b2aedf 100644
--- a/talk/media/base/videoengine_unittest.h
+++ b/webrtc/media/base/videoengine_unittest.h
@@ -25,22 +25,22 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_  // NOLINT
-#define TALK_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_
+#ifndef WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_  // NOLINT
+#define WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/base/fakenetworkinterface.h"
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/fakevideorenderer.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/streamparams.h"
-#include "talk/media/webrtc/fakewebrtccall.h"
 #include "webrtc/base/bytebuffer.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/timeutils.h"
 #include "webrtc/call.h"
+#include "webrtc/media/base/fakenetworkinterface.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/fakevideorenderer.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/streamparams.h"
+#include "webrtc/media/webrtc/fakewebrtccall.h"
 
 #define EXPECT_FRAME_WAIT(c, w, h, t) \
   EXPECT_EQ_WAIT((c), renderer_.num_rendered_frames(), (t)); \
@@ -1220,4 +1220,4 @@
   cricket::FakeVideoRenderer renderer2_;
 };
 
-#endif  // TALK_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_  NOLINT
+#endif  // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_  NOLINT
diff --git a/talk/media/base/videoframe.cc b/webrtc/media/base/videoframe.cc
similarity index 99%
rename from talk/media/base/videoframe.cc
rename to webrtc/media/base/videoframe.cc
index 7e36481..ef0cc8b 100644
--- a/talk/media/base/videoframe.cc
+++ b/webrtc/media/base/videoframe.cc
@@ -25,17 +25,17 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/videoframe.h"
+#include "webrtc/media/base/videoframe.h"
 
 #include <string.h>
 
 #include "libyuv/compare.h"
 #include "libyuv/planar_functions.h"
 #include "libyuv/scale.h"
-#include "talk/media/base/videocommon.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/base/videocommon.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/videoframe.h b/webrtc/media/base/videoframe.h
similarity index 98%
rename from talk/media/base/videoframe.h
rename to webrtc/media/base/videoframe.h
index aaa329a..de83a07 100644
--- a/talk/media/base/videoframe.h
+++ b/webrtc/media/base/videoframe.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_VIDEOFRAME_H_
-#define TALK_MEDIA_BASE_VIDEOFRAME_H_
+#ifndef WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
+#define WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
 
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/stream.h"
@@ -209,4 +209,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_VIDEOFRAME_H_
+#endif  // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
diff --git a/talk/media/base/videoframe_unittest.h b/webrtc/media/base/videoframe_unittest.h
similarity index 99%
rename from talk/media/base/videoframe_unittest.h
rename to webrtc/media/base/videoframe_unittest.h
index 372a370..0b6faaf 100644
--- a/talk/media/base/videoframe_unittest.h
+++ b/webrtc/media/base/videoframe_unittest.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_
-#define TALK_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_
+#ifndef WEBRTC_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_
+#define WEBRTC_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_
 
 #include <algorithm>
 #include <string>
@@ -35,14 +35,14 @@
 #include "libyuv/convert_from.h"
 #include "libyuv/planar_functions.h"
 #include "libyuv/rotate.h"
-#include "talk/media/base/testutils.h"
-#include "talk/media/base/videocommon.h"
-#include "talk/media/base/videoframe.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/pathutils.h"
 #include "webrtc/base/stream.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/common_video/rotation.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/base/videoframe.h"
 
 #if defined(_MSC_VER)
 #define ALIGN16(var) __declspec(align(16)) var
@@ -1946,4 +1946,4 @@
   int repeat_;
 };
 
-#endif  // TALK_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_
+#endif  // WEBRTC_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_
diff --git a/talk/media/base/videoframefactory.cc b/webrtc/media/base/videoframefactory.cc
similarity index 96%
rename from talk/media/base/videoframefactory.cc
rename to webrtc/media/base/videoframefactory.cc
index fb81096..6c521cb 100644
--- a/talk/media/base/videoframefactory.cc
+++ b/webrtc/media/base/videoframefactory.cc
@@ -25,10 +25,10 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/videoframefactory.h"
+#include "webrtc/media/base/videoframefactory.h"
 
 #include <algorithm>
-#include "talk/media/base/videocapturer.h"
+#include "webrtc/media/base/videocapturer.h"
 
 namespace cricket {
 
diff --git a/talk/media/base/videoframefactory.h b/webrtc/media/base/videoframefactory.h
similarity index 94%
rename from talk/media/base/videoframefactory.h
rename to webrtc/media/base/videoframefactory.h
index ba8c517..12ed9d6 100644
--- a/talk/media/base/videoframefactory.h
+++ b/webrtc/media/base/videoframefactory.h
@@ -25,11 +25,11 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_VIDEOFRAMEFACTORY_H_
-#define TALK_MEDIA_BASE_VIDEOFRAMEFACTORY_H_
+#ifndef WEBRTC_MEDIA_BASE_VIDEOFRAMEFACTORY_H_
+#define WEBRTC_MEDIA_BASE_VIDEOFRAMEFACTORY_H_
 
-#include "talk/media/base/videoframe.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/videoframe.h"
 
 namespace cricket {
 
@@ -75,4 +75,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_VIDEOFRAMEFACTORY_H_
+#endif  // WEBRTC_MEDIA_BASE_VIDEOFRAMEFACTORY_H_
diff --git a/talk/media/base/videorenderer.h b/webrtc/media/base/videorenderer.h
similarity index 93%
rename from talk/media/base/videorenderer.h
rename to webrtc/media/base/videorenderer.h
index 9771c49..a930430 100644
--- a/talk/media/base/videorenderer.h
+++ b/webrtc/media/base/videorenderer.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_BASE_VIDEORENDERER_H_
-#define TALK_MEDIA_BASE_VIDEORENDERER_H_
+#ifndef WEBRTC_MEDIA_BASE_VIDEORENDERER_H_
+#define WEBRTC_MEDIA_BASE_VIDEORENDERER_H_
 
 #include "webrtc/media/base/videosinkinterface.h"
 
@@ -49,4 +49,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_VIDEORENDERER_H_
+#endif  // WEBRTC_MEDIA_BASE_VIDEORENDERER_H_
diff --git a/talk/media/base/yuvframegenerator.cc b/webrtc/media/base/yuvframegenerator.cc
similarity index 98%
rename from talk/media/base/yuvframegenerator.cc
rename to webrtc/media/base/yuvframegenerator.cc
index 2bec4e4..548e97d 100644
--- a/talk/media/base/yuvframegenerator.cc
+++ b/webrtc/media/base/yuvframegenerator.cc
@@ -1,6 +1,6 @@
 /*
  * libjingle
- * Copyright 2004--2014 Google Inc.
+ * Copyright 2004 Google Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/base/yuvframegenerator.h"
+#include "webrtc/media/base/yuvframegenerator.h"
 
 #include <string.h>
 #include <sstream>
diff --git a/talk/media/base/yuvframegenerator.h b/webrtc/media/base/yuvframegenerator.h
similarity index 96%
rename from talk/media/base/yuvframegenerator.h
rename to webrtc/media/base/yuvframegenerator.h
index 9091362..7f4b32e 100644
--- a/talk/media/base/yuvframegenerator.h
+++ b/webrtc/media/base/yuvframegenerator.h
@@ -36,8 +36,8 @@
 // handy visual help for noticing e.g. packet loss if the frames are encoded
 // and sent over the network.
 
-#ifndef TALK_MEDIA_BASE_YUVFRAMEGENERATOR_H_
-#define TALK_MEDIA_BASE_YUVFRAMEGENERATOR_H_
+#ifndef WEBRTC_MEDIA_BASE_YUVFRAMEGENERATOR_H_
+#define WEBRTC_MEDIA_BASE_YUVFRAMEGENERATOR_H_
 
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/constructormagic.h"
@@ -108,4 +108,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_BASE_YUVFRAMEGENERATOR_H_
+#endif  // WEBRTC_MEDIA_BASE_YUVFRAMEGENERATOR_H_
diff --git a/talk/media/devices/carbonvideorenderer.cc b/webrtc/media/devices/carbonvideorenderer.cc
similarity index 97%
rename from talk/media/devices/carbonvideorenderer.cc
rename to webrtc/media/devices/carbonvideorenderer.cc
index b711ae4..221ffa5 100644
--- a/talk/media/devices/carbonvideorenderer.cc
+++ b/webrtc/media/devices/carbonvideorenderer.cc
@@ -27,11 +27,11 @@
 
 // Implementation of CarbonVideoRenderer
 
-#include "talk/media/devices/carbonvideorenderer.h"
+#include "webrtc/media/devices/carbonvideorenderer.h"
 
-#include "talk/media/base/videocommon.h"
-#include "talk/media/base/videoframe.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/base/videoframe.h"
 
 namespace cricket {
 
diff --git a/talk/media/devices/carbonvideorenderer.h b/webrtc/media/devices/carbonvideorenderer.h
similarity index 92%
rename from talk/media/devices/carbonvideorenderer.h
rename to webrtc/media/devices/carbonvideorenderer.h
index e8329ea..7492b61 100644
--- a/talk/media/devices/carbonvideorenderer.h
+++ b/webrtc/media/devices/carbonvideorenderer.h
@@ -28,14 +28,14 @@
 // Definition of class CarbonVideoRenderer that implements the abstract class
 // cricket::VideoRenderer via Carbon.
 
-#ifndef TALK_MEDIA_DEVICES_CARBONVIDEORENDERER_H_
-#define TALK_MEDIA_DEVICES_CARBONVIDEORENDERER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_CARBONVIDEORENDERER_H_
+#define WEBRTC_MEDIA_DEVICES_CARBONVIDEORENDERER_H_
 
 #include <Carbon/Carbon.h>
 
-#include "talk/media/base/videorenderer.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/videorenderer.h"
 
 namespace cricket {
 
@@ -70,4 +70,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_CARBONVIDEORENDERER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_CARBONVIDEORENDERER_H_
diff --git a/talk/media/devices/deviceinfo.h b/webrtc/media/devices/deviceinfo.h
similarity index 89%
rename from talk/media/devices/deviceinfo.h
rename to webrtc/media/devices/deviceinfo.h
index 86382f6..81fb201 100644
--- a/talk/media/devices/deviceinfo.h
+++ b/webrtc/media/devices/deviceinfo.h
@@ -25,12 +25,12 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_DEVICES_DEVICEINFO_H_
-#define TALK_MEDIA_DEVICES_DEVICEINFO_H_
+#ifndef WEBRTC_MEDIA_DEVICES_DEVICEINFO_H_
+#define WEBRTC_MEDIA_DEVICES_DEVICEINFO_H_
 
 #include <string>
 
-#include "talk/media/devices/devicemanager.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 namespace cricket {
 
@@ -39,4 +39,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_DEVICEINFO_H_
+#endif  // WEBRTC_MEDIA_DEVICES_DEVICEINFO_H_
diff --git a/talk/media/devices/devicemanager.cc b/webrtc/media/devices/devicemanager.cc
similarity index 96%
rename from talk/media/devices/devicemanager.cc
rename to webrtc/media/devices/devicemanager.cc
index eca14a5..a3f34fd 100644
--- a/talk/media/devices/devicemanager.cc
+++ b/webrtc/media/devices/devicemanager.cc
@@ -25,13 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/devicemanager.h"
+#include "webrtc/media/devices/devicemanager.h"
 
-#include "talk/media/base/mediacommon.h"
-#include "talk/media/base/videocapturerfactory.h"
-#include "talk/media/devices/deviceinfo.h"
-#include "talk/media/devices/filevideocapturer.h"
-#include "talk/media/devices/yuvframescapturer.h"
 #include "webrtc/base/fileutils.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/pathutils.h"
@@ -39,9 +34,14 @@
 #include "webrtc/base/thread.h"
 #include "webrtc/base/windowpicker.h"
 #include "webrtc/base/windowpickerfactory.h"
+#include "webrtc/media/base/mediacommon.h"
+#include "webrtc/media/base/videocapturerfactory.h"
+#include "webrtc/media/devices/deviceinfo.h"
+#include "webrtc/media/devices/filevideocapturer.h"
+#include "webrtc/media/devices/yuvframescapturer.h"
 
 #ifdef HAVE_WEBRTC_VIDEO
-#include "talk/media/webrtc/webrtcvideocapturerfactory.h"
+#include "webrtc/media/webrtc/webrtcvideocapturerfactory.h"
 #endif  // HAVE_WEBRTC_VIDEO
 
 namespace {
diff --git a/talk/media/devices/devicemanager.h b/webrtc/media/devices/devicemanager.h
similarity index 95%
rename from talk/media/devices/devicemanager.h
rename to webrtc/media/devices/devicemanager.h
index 982c679..932fc5b 100644
--- a/talk/media/devices/devicemanager.h
+++ b/webrtc/media/devices/devicemanager.h
@@ -25,21 +25,21 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_DEVICES_DEVICEMANAGER_H_
-#define TALK_MEDIA_DEVICES_DEVICEMANAGER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_DEVICEMANAGER_H_
+#define WEBRTC_MEDIA_DEVICES_DEVICEMANAGER_H_
 
 #include <map>
 #include <string>
 #include <vector>
 
-#include "talk/media/base/device.h"
-#include "talk/media/base/screencastid.h"
-#include "talk/media/base/videocapturerfactory.h"
-#include "talk/media/base/videocommon.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/stringencode.h"
 #include "webrtc/base/window.h"
+#include "webrtc/media/base/device.h"
+#include "webrtc/media/base/screencastid.h"
+#include "webrtc/media/base/videocapturerfactory.h"
+#include "webrtc/media/base/videocommon.h"
 
 namespace rtc {
 
@@ -208,4 +208,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_DEVICEMANAGER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_DEVICEMANAGER_H_
diff --git a/talk/media/devices/devicemanager_unittest.cc b/webrtc/media/devices/devicemanager_unittest.cc
similarity index 97%
rename from talk/media/devices/devicemanager_unittest.cc
rename to webrtc/media/devices/devicemanager_unittest.cc
index 606a05e..1fded4b 100644
--- a/talk/media/devices/devicemanager_unittest.cc
+++ b/webrtc/media/devices/devicemanager_unittest.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/devicemanager.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 #ifdef WIN32
 #include <objbase.h>
@@ -33,12 +33,6 @@
 #endif
 #include <string>
 
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/screencastid.h"
-#include "talk/media/base/testutils.h"
-#include "talk/media/base/videocapturerfactory.h"
-#include "talk/media/devices/filevideocapturer.h"
-#include "talk/media/devices/v4llookup.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/fileutils.h"
 #include "webrtc/base/gunit.h"
@@ -47,6 +41,12 @@
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/stream.h"
 #include "webrtc/base/windowpickerfactory.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/screencastid.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/base/videocapturerfactory.h"
+#include "webrtc/media/devices/filevideocapturer.h"
+#include "webrtc/media/devices/v4llookup.h"
 
 #ifdef WEBRTC_LINUX
 // TODO(juberti): Figure out why this doesn't compile on Windows.
diff --git a/talk/media/devices/dummydevicemanager.cc b/webrtc/media/devices/dummydevicemanager.cc
similarity index 96%
rename from talk/media/devices/dummydevicemanager.cc
rename to webrtc/media/devices/dummydevicemanager.cc
index 736258b..a2de481 100644
--- a/talk/media/devices/dummydevicemanager.cc
+++ b/webrtc/media/devices/dummydevicemanager.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/dummydevicemanager.h"
+#include "webrtc/media/devices/dummydevicemanager.h"
 
 namespace cricket {
 
diff --git a/talk/media/devices/dummydevicemanager.h b/webrtc/media/devices/dummydevicemanager.h
similarity index 87%
rename from talk/media/devices/dummydevicemanager.h
rename to webrtc/media/devices/dummydevicemanager.h
index 7da8185..e867dc7 100644
--- a/talk/media/devices/dummydevicemanager.h
+++ b/webrtc/media/devices/dummydevicemanager.h
@@ -25,13 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_DEVICES_DUMMYDEVICEMANAGER_H_
-#define TALK_MEDIA_DEVICES_DUMMYDEVICEMANAGER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_DUMMYDEVICEMANAGER_H_
+#define WEBRTC_MEDIA_DEVICES_DUMMYDEVICEMANAGER_H_
 
 #include <vector>
 
-#include "talk/media/base/mediacommon.h"
-#include "talk/media/devices/fakedevicemanager.h"
+#include "webrtc/media/base/mediacommon.h"
+#include "webrtc/media/devices/fakedevicemanager.h"
 
 namespace cricket {
 
@@ -48,4 +48,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_DUMMYDEVICEMANAGER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_DUMMYDEVICEMANAGER_H_
diff --git a/talk/media/devices/dummydevicemanager_unittest.cc b/webrtc/media/devices/dummydevicemanager_unittest.cc
similarity index 98%
rename from talk/media/devices/dummydevicemanager_unittest.cc
rename to webrtc/media/devices/dummydevicemanager_unittest.cc
index 9f4eb41..5afa267 100644
--- a/talk/media/devices/dummydevicemanager_unittest.cc
+++ b/webrtc/media/devices/dummydevicemanager_unittest.cc
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/dummydevicemanager.h"
 #include "webrtc/base/gunit.h"
+#include "webrtc/media/devices/dummydevicemanager.h"
 
 using cricket::Device;
 using cricket::DummyDeviceManager;
diff --git a/talk/media/devices/fakedevicemanager.h b/webrtc/media/devices/fakedevicemanager.h
similarity index 96%
rename from talk/media/devices/fakedevicemanager.h
rename to webrtc/media/devices/fakedevicemanager.h
index 77a8342..c1b8cd0 100644
--- a/talk/media/devices/fakedevicemanager.h
+++ b/webrtc/media/devices/fakedevicemanager.h
@@ -25,18 +25,18 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_
-#define TALK_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_
+#define WEBRTC_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/base/fakevideocapturer.h"
-#include "talk/media/base/mediacommon.h"
-#include "talk/media/devices/devicemanager.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/window.h"
 #include "webrtc/base/windowpicker.h"
+#include "webrtc/media/base/fakevideocapturer.h"
+#include "webrtc/media/base/mediacommon.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 namespace cricket {
 
@@ -236,4 +236,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_
diff --git a/talk/media/devices/filevideocapturer.cc b/webrtc/media/devices/filevideocapturer.cc
similarity index 99%
rename from talk/media/devices/filevideocapturer.cc
rename to webrtc/media/devices/filevideocapturer.cc
index 8849a09..466170a 100644
--- a/talk/media/devices/filevideocapturer.cc
+++ b/webrtc/media/devices/filevideocapturer.cc
@@ -27,7 +27,7 @@
 
 // Implementation of VideoRecorder and FileVideoCapturer.
 
-#include "talk/media/devices/filevideocapturer.h"
+#include "webrtc/media/devices/filevideocapturer.h"
 
 #include "webrtc/base/bytebuffer.h"
 #include "webrtc/base/criticalsection.h"
diff --git a/talk/media/devices/filevideocapturer.h b/webrtc/media/devices/filevideocapturer.h
similarity index 96%
rename from talk/media/devices/filevideocapturer.h
rename to webrtc/media/devices/filevideocapturer.h
index cc41c39..4631b93 100644
--- a/talk/media/devices/filevideocapturer.h
+++ b/webrtc/media/devices/filevideocapturer.h
@@ -34,15 +34,15 @@
 // FileVideoCapturer, a subclass of VideoCapturer, is a simulated video capturer
 // that periodically reads images from a previously recorded file.
 
-#ifndef TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_
-#define TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_
+#define WEBRTC_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/base/videocapturer.h"
 #include "webrtc/base/stream.h"
 #include "webrtc/base/stringutils.h"
+#include "webrtc/media/base/videocapturer.h"
 
 namespace rtc {
 class FileStream;
@@ -157,4 +157,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_
diff --git a/talk/media/devices/filevideocapturer_unittest.cc b/webrtc/media/devices/filevideocapturer_unittest.cc
similarity index 98%
rename from talk/media/devices/filevideocapturer_unittest.cc
rename to webrtc/media/devices/filevideocapturer_unittest.cc
index ccd2407..b34b69f 100644
--- a/talk/media/devices/filevideocapturer_unittest.cc
+++ b/webrtc/media/devices/filevideocapturer_unittest.cc
@@ -30,11 +30,11 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/testutils.h"
-#include "talk/media/devices/filevideocapturer.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/devices/filevideocapturer.h"
 
 namespace {
 
diff --git a/talk/media/devices/gdivideorenderer.cc b/webrtc/media/devices/gdivideorenderer.cc
similarity index 98%
rename from talk/media/devices/gdivideorenderer.cc
rename to webrtc/media/devices/gdivideorenderer.cc
index 6945306..f386455 100644
--- a/talk/media/devices/gdivideorenderer.cc
+++ b/webrtc/media/devices/gdivideorenderer.cc
@@ -29,13 +29,13 @@
 
 #ifdef WIN32
 
-#include "talk/media/devices/gdivideorenderer.h"
+#include "webrtc/media/devices/gdivideorenderer.h"
 
-#include "talk/media/base/videocommon.h"
-#include "talk/media/base/videoframe.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/thread.h"
 #include "webrtc/base/win32window.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/base/videoframe.h"
 
 namespace cricket {
 
diff --git a/talk/media/devices/gdivideorenderer.h b/webrtc/media/devices/gdivideorenderer.h
old mode 100755
new mode 100644
similarity index 91%
rename from talk/media/devices/gdivideorenderer.h
rename to webrtc/media/devices/gdivideorenderer.h
index 0e4f6cf..52d59a6
--- a/talk/media/devices/gdivideorenderer.h
+++ b/webrtc/media/devices/gdivideorenderer.h
@@ -29,12 +29,12 @@
 // Definition of class GdiVideoRenderer that implements the abstract class
 // cricket::VideoRenderer via GDI on Windows.
 
-#ifndef TALK_MEDIA_DEVICES_GDIVIDEORENDERER_H_
-#define TALK_MEDIA_DEVICES_GDIVIDEORENDERER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_
+#define WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_
 
 #ifdef WIN32
-#include "talk/media/base/videorenderer.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/videorenderer.h"
 
 namespace cricket {
 
@@ -60,4 +60,4 @@
 }  // namespace cricket
 
 #endif  // WIN32
-#endif  // TALK_MEDIA_DEVICES_GDIVIDEORENDERER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_
diff --git a/talk/media/devices/gtkvideorenderer.cc b/webrtc/media/devices/gtkvideorenderer.cc
old mode 100755
new mode 100644
similarity index 97%
rename from talk/media/devices/gtkvideorenderer.cc
rename to webrtc/media/devices/gtkvideorenderer.cc
index d389960..8ac5a8c
--- a/talk/media/devices/gtkvideorenderer.cc
+++ b/webrtc/media/devices/gtkvideorenderer.cc
@@ -27,14 +27,14 @@
 
 // Implementation of GtkVideoRenderer
 
-#include "talk/media/devices/gtkvideorenderer.h"
+#include "webrtc/media/devices/gtkvideorenderer.h"
 
 #include <gdk/gdk.h>
 #include <glib.h>
 #include <gtk/gtk.h>
 
-#include "talk/media/base/videocommon.h"
-#include "talk/media/base/videoframe.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/base/videoframe.h"
 
 namespace cricket {
 
diff --git a/talk/media/devices/gtkvideorenderer.h b/webrtc/media/devices/gtkvideorenderer.h
old mode 100755
new mode 100644
similarity index 92%
rename from talk/media/devices/gtkvideorenderer.h
rename to webrtc/media/devices/gtkvideorenderer.h
index 0270a7a..f79649d
--- a/talk/media/devices/gtkvideorenderer.h
+++ b/webrtc/media/devices/gtkvideorenderer.h
@@ -28,12 +28,12 @@
 // Definition of class GtkVideoRenderer that implements the abstract class
 // cricket::VideoRenderer via GTK.
 
-#ifndef TALK_MEDIA_DEVICES_GTKVIDEORENDERER_H_
-#define TALK_MEDIA_DEVICES_GTKVIDEORENDERER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_
+#define WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_
 
-#include "talk/media/base/videorenderer.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/videorenderer.h"
 
 typedef struct _GtkWidget GtkWidget;  // forward declaration, defined in gtk.h
 
@@ -71,4 +71,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_GTKVIDEORENDERER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_GTKVIDEORENDERER_H_
diff --git a/talk/media/devices/libudevsymboltable.cc b/webrtc/media/devices/libudevsymboltable.cc
similarity index 98%
rename from talk/media/devices/libudevsymboltable.cc
rename to webrtc/media/devices/libudevsymboltable.cc
index 351a1e7..52a4437 100644
--- a/talk/media/devices/libudevsymboltable.cc
+++ b/webrtc/media/devices/libudevsymboltable.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/libudevsymboltable.h"
+#include "webrtc/media/devices/libudevsymboltable.h"
 
 #include <dlfcn.h>
 
diff --git a/talk/media/devices/libudevsymboltable.h b/webrtc/media/devices/libudevsymboltable.h
similarity index 95%
rename from talk/media/devices/libudevsymboltable.h
rename to webrtc/media/devices/libudevsymboltable.h
index f764cd2..e9083fa 100644
--- a/talk/media/devices/libudevsymboltable.h
+++ b/webrtc/media/devices/libudevsymboltable.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_
-#define TALK_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_
+#ifndef WEBRTC_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_
+#define WEBRTC_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_
 
 #include <libudev.h>
 
@@ -76,4 +76,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_
+#endif  // WEBRTC_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_
diff --git a/talk/media/devices/linuxdeviceinfo.cc b/webrtc/media/devices/linuxdeviceinfo.cc
similarity index 97%
rename from talk/media/devices/linuxdeviceinfo.cc
rename to webrtc/media/devices/linuxdeviceinfo.cc
index 0b22e15..0df2c8d 100644
--- a/talk/media/devices/linuxdeviceinfo.cc
+++ b/webrtc/media/devices/linuxdeviceinfo.cc
@@ -25,10 +25,10 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/deviceinfo.h"
+#include "webrtc/media/devices/deviceinfo.h"
 
-#include "talk/media/devices/libudevsymboltable.h"
 #include "webrtc/base/common.h"  // for ASSERT
+#include "webrtc/media/devices/libudevsymboltable.h"
 
 namespace cricket {
 
diff --git a/talk/media/devices/linuxdevicemanager.cc b/webrtc/media/devices/linuxdevicemanager.cc
similarity index 98%
rename from talk/media/devices/linuxdevicemanager.cc
rename to webrtc/media/devices/linuxdevicemanager.cc
index 25be321..4573a4d 100644
--- a/talk/media/devices/linuxdevicemanager.cc
+++ b/webrtc/media/devices/linuxdevicemanager.cc
@@ -25,16 +25,9 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/linuxdevicemanager.h"
+#include "webrtc/media/devices/linuxdevicemanager.h"
 
 #include <unistd.h>
-#include "talk/media/base/mediacommon.h"
-#include "talk/media/devices/libudevsymboltable.h"
-#include "talk/media/devices/v4llookup.h"
-#include "webrtc/sound/platformsoundsystem.h"
-#include "webrtc/sound/platformsoundsystemfactory.h"
-#include "webrtc/sound/sounddevicelocator.h"
-#include "webrtc/sound/soundsysteminterface.h"
 #include "webrtc/base/fileutils.h"
 #include "webrtc/base/linux.h"
 #include "webrtc/base/logging.h"
@@ -43,6 +36,13 @@
 #include "webrtc/base/stream.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/mediacommon.h"
+#include "webrtc/media/devices/libudevsymboltable.h"
+#include "webrtc/media/devices/v4llookup.h"
+#include "webrtc/sound/platformsoundsystem.h"
+#include "webrtc/sound/platformsoundsystemfactory.h"
+#include "webrtc/sound/sounddevicelocator.h"
+#include "webrtc/sound/soundsysteminterface.h"
 
 namespace cricket {
 
diff --git a/talk/media/devices/linuxdevicemanager.h b/webrtc/media/devices/linuxdevicemanager.h
similarity index 90%
rename from talk/media/devices/linuxdevicemanager.h
rename to webrtc/media/devices/linuxdevicemanager.h
index 1eb648f..943b9e2 100644
--- a/talk/media/devices/linuxdevicemanager.h
+++ b/webrtc/media/devices/linuxdevicemanager.h
@@ -25,16 +25,16 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_DEVICES_LINUXDEVICEMANAGER_H_
-#define TALK_MEDIA_DEVICES_LINUXDEVICEMANAGER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_LINUXDEVICEMANAGER_H_
+#define WEBRTC_MEDIA_DEVICES_LINUXDEVICEMANAGER_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/devices/devicemanager.h"
-#include "webrtc/sound/soundsystemfactory.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/stringencode.h"
+#include "webrtc/media/devices/devicemanager.h"
+#include "webrtc/sound/soundsystemfactory.h"
 
 namespace cricket {
 
@@ -52,4 +52,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_LINUXDEVICEMANAGER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_LINUXDEVICEMANAGER_H_
diff --git a/talk/media/devices/macdeviceinfo.cc b/webrtc/media/devices/macdeviceinfo.cc
similarity index 97%
rename from talk/media/devices/macdeviceinfo.cc
rename to webrtc/media/devices/macdeviceinfo.cc
index f34932d..fbb0620 100644
--- a/talk/media/devices/macdeviceinfo.cc
+++ b/webrtc/media/devices/macdeviceinfo.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/deviceinfo.h"
+#include "webrtc/media/devices/deviceinfo.h"
 
 namespace cricket {
 
diff --git a/talk/media/devices/macdevicemanager.cc b/webrtc/media/devices/macdevicemanager.cc
similarity index 98%
rename from talk/media/devices/macdevicemanager.cc
rename to webrtc/media/devices/macdevicemanager.cc
index 8f777b4..e965399 100644
--- a/talk/media/devices/macdevicemanager.cc
+++ b/webrtc/media/devices/macdevicemanager.cc
@@ -25,15 +25,15 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/macdevicemanager.h"
+#include "webrtc/media/devices/macdevicemanager.h"
 
 #include <CoreAudio/CoreAudio.h>
 #include <QuickTime/QuickTime.h>
 
-#include "talk/media/base/mediacommon.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/mediacommon.h"
 
 class DeviceWatcherImpl;
 
diff --git a/talk/media/devices/macdevicemanager.h b/webrtc/media/devices/macdevicemanager.h
similarity index 90%
rename from talk/media/devices/macdevicemanager.h
rename to webrtc/media/devices/macdevicemanager.h
index 82e62f9..f8f580d 100644
--- a/talk/media/devices/macdevicemanager.h
+++ b/webrtc/media/devices/macdevicemanager.h
@@ -25,15 +25,15 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_DEVICES_MACDEVICEMANAGER_H_
-#define TALK_MEDIA_DEVICES_MACDEVICEMANAGER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_MACDEVICEMANAGER_H_
+#define WEBRTC_MEDIA_DEVICES_MACDEVICEMANAGER_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/devices/devicemanager.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/stringencode.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 namespace cricket {
 
@@ -53,4 +53,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_MACDEVICEMANAGER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_MACDEVICEMANAGER_H_
diff --git a/talk/media/devices/macdevicemanagermm.mm b/webrtc/media/devices/macdevicemanagermm.mm
similarity index 98%
rename from talk/media/devices/macdevicemanagermm.mm
rename to webrtc/media/devices/macdevicemanagermm.mm
index ed5934d..6845fe0 100644
--- a/talk/media/devices/macdevicemanagermm.mm
+++ b/webrtc/media/devices/macdevicemanagermm.mm
@@ -30,7 +30,7 @@
 #define __has_feature(x) 0
 #endif
 
-#include "talk/media/devices/devicemanager.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 #import <assert.h>
 #ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
diff --git a/talk/media/devices/mobiledevicemanager.cc b/webrtc/media/devices/mobiledevicemanager.cc
similarity index 98%
rename from talk/media/devices/mobiledevicemanager.cc
rename to webrtc/media/devices/mobiledevicemanager.cc
index 5739c7e..b3d0bdd 100644
--- a/talk/media/devices/mobiledevicemanager.cc
+++ b/webrtc/media/devices/mobiledevicemanager.cc
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/devicemanager.h"
 #include "webrtc/base/arraysize.h"
+#include "webrtc/media/devices/devicemanager.h"
 #include "webrtc/modules/video_capture/video_capture_factory.h"
 
 namespace cricket {
diff --git a/talk/media/devices/v4llookup.cc b/webrtc/media/devices/v4llookup.cc
similarity index 98%
rename from talk/media/devices/v4llookup.cc
rename to webrtc/media/devices/v4llookup.cc
index 20b534c..011f63a 100644
--- a/talk/media/devices/v4llookup.cc
+++ b/webrtc/media/devices/v4llookup.cc
@@ -32,7 +32,7 @@
  * The functionality is implemented as a class with virtual methods for
  * the purpose of unit testing.
  */
-#include "talk/media/devices/v4llookup.h"
+#include "webrtc/media/devices/v4llookup.h"
 
 #include <errno.h>
 #include <fcntl.h>
diff --git a/talk/media/devices/v4llookup.h b/webrtc/media/devices/v4llookup.h
similarity index 94%
rename from talk/media/devices/v4llookup.h
rename to webrtc/media/devices/v4llookup.h
index 5c53ede..67c6066 100644
--- a/talk/media/devices/v4llookup.h
+++ b/webrtc/media/devices/v4llookup.h
@@ -32,8 +32,8 @@
  * The functionality is implemented as a class with virtual methods for
  * the purpose of unit testing.
  */
-#ifndef TALK_MEDIA_DEVICES_V4LLOOKUP_H_
-#define TALK_MEDIA_DEVICES_V4LLOOKUP_H_
+#ifndef WEBRTC_MEDIA_DEVICES_V4LLOOKUP_H_
+#define WEBRTC_MEDIA_DEVICES_V4LLOOKUP_H_
 
 #include <string>
 
@@ -67,4 +67,4 @@
 }  // namespace cricket
 
 #endif  // WEBRTC_LINUX
-#endif  // TALK_MEDIA_DEVICES_V4LLOOKUP_H_
+#endif  // WEBRTC_MEDIA_DEVICES_V4LLOOKUP_H_
diff --git a/talk/media/devices/videorendererfactory.h b/webrtc/media/devices/videorendererfactory.h
similarity index 86%
rename from talk/media/devices/videorendererfactory.h
rename to webrtc/media/devices/videorendererfactory.h
index b7128f6..3c13b45 100644
--- a/talk/media/devices/videorendererfactory.h
+++ b/webrtc/media/devices/videorendererfactory.h
@@ -28,16 +28,16 @@
 //
 // A factory to create a GUI video renderer.
 
-#ifndef TALK_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_
-#define TALK_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_
+#ifndef WEBRTC_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_
+#define WEBRTC_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_
 
-#include "talk/media/base/videorenderer.h"
+#include "webrtc/media/base/videorenderer.h"
 #if defined(WEBRTC_LINUX) && defined(HAVE_GTK)
-#include "talk/media/devices/gtkvideorenderer.h"
+#include "webrtc/media/devices/gtkvideorenderer.h"
 #elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) && !defined(CARBON_DEPRECATED)
-#include "talk/media/devices/carbonvideorenderer.h"
+#include "webrtc/media/devices/carbonvideorenderer.h"
 #elif defined(WIN32)
-#include "talk/media/devices/gdivideorenderer.h"
+#include "webrtc/media/devices/gdivideorenderer.h"
 #endif
 
 namespace cricket {
@@ -67,4 +67,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_
+#endif  // WEBRTC_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_
diff --git a/talk/media/devices/win32deviceinfo.cc b/webrtc/media/devices/win32deviceinfo.cc
similarity index 97%
rename from talk/media/devices/win32deviceinfo.cc
rename to webrtc/media/devices/win32deviceinfo.cc
index 61a7759..332bc6d 100644
--- a/talk/media/devices/win32deviceinfo.cc
+++ b/webrtc/media/devices/win32deviceinfo.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/deviceinfo.h"
+#include "webrtc/media/devices/deviceinfo.h"
 
 namespace cricket {
 
diff --git a/talk/media/devices/win32devicemanager.cc b/webrtc/media/devices/win32devicemanager.cc
similarity index 98%
rename from talk/media/devices/win32devicemanager.cc
rename to webrtc/media/devices/win32devicemanager.cc
index f34e3c4..7f32255 100644
--- a/talk/media/devices/win32devicemanager.cc
+++ b/webrtc/media/devices/win32devicemanager.cc
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/win32devicemanager.h"
+#include "webrtc/media/devices/win32devicemanager.h"
 
 #include <atlbase.h>
 #include <dbt.h>
@@ -54,7 +54,7 @@
 #include "webrtc/base/thread.h"
 #include "webrtc/base/win32.h"  // ToUtf8
 #include "webrtc/base/win32window.h"
-#include "talk/media/base/mediacommon.h"
+#include "webrtc/media/base/mediacommon.h"
 #ifdef HAVE_LOGITECH_HEADERS
 #include "third_party/logitech/files/logitechquickcam.h"
 #endif
diff --git a/talk/media/devices/win32devicemanager.h b/webrtc/media/devices/win32devicemanager.h
similarity index 90%
rename from talk/media/devices/win32devicemanager.h
rename to webrtc/media/devices/win32devicemanager.h
index 5f8ba83..1460034 100644
--- a/talk/media/devices/win32devicemanager.h
+++ b/webrtc/media/devices/win32devicemanager.h
@@ -25,15 +25,15 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_DEVICES_WIN32DEVICEMANAGER_H_
-#define TALK_MEDIA_DEVICES_WIN32DEVICEMANAGER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_WIN32DEVICEMANAGER_H_
+#define WEBRTC_MEDIA_DEVICES_WIN32DEVICEMANAGER_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/devices/devicemanager.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/stringencode.h"
+#include "webrtc/media/devices/devicemanager.h"
 
 namespace cricket {
 
@@ -57,4 +57,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_WIN32DEVICEMANAGER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_WIN32DEVICEMANAGER_H_
diff --git a/talk/media/devices/yuvframescapturer.cc b/webrtc/media/devices/yuvframescapturer.cc
similarity index 98%
rename from talk/media/devices/yuvframescapturer.cc
rename to webrtc/media/devices/yuvframescapturer.cc
index 269c97c..c36de9b 100644
--- a/talk/media/devices/yuvframescapturer.cc
+++ b/webrtc/media/devices/yuvframescapturer.cc
@@ -1,6 +1,6 @@
 /*
  * libjingle
- * Copyright 2004--2014 Google Inc.
+ * Copyright 2004 Google Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -25,7 +25,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/devices/yuvframescapturer.h"
+#include "webrtc/media/devices/yuvframescapturer.h"
 
 #include "webrtc/base/bytebuffer.h"
 #include "webrtc/base/criticalsection.h"
diff --git a/talk/media/devices/yuvframescapturer.h b/webrtc/media/devices/yuvframescapturer.h
similarity index 92%
rename from talk/media/devices/yuvframescapturer.h
rename to webrtc/media/devices/yuvframescapturer.h
index 850a8df..2dd0857 100644
--- a/talk/media/devices/yuvframescapturer.h
+++ b/webrtc/media/devices/yuvframescapturer.h
@@ -25,16 +25,16 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_DEVICES_YUVFRAMESCAPTURER_H_
-#define TALK_MEDIA_DEVICES_YUVFRAMESCAPTURER_H_
+#ifndef WEBRTC_MEDIA_DEVICES_YUVFRAMESCAPTURER_H_
+#define WEBRTC_MEDIA_DEVICES_YUVFRAMESCAPTURER_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/yuvframegenerator.h"
 #include "webrtc/base/stream.h"
 #include "webrtc/base/stringutils.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/yuvframegenerator.h"
 
 
 namespace rtc {
@@ -95,4 +95,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_DEVICES_YUVFRAMESCAPTURER_H_
+#endif  // WEBRTC_MEDIA_DEVICES_YUVFRAMESCAPTURER_H_
diff --git a/webrtc/media/media.gyp b/webrtc/media/media.gyp
new file mode 100644
index 0000000..107918e
--- /dev/null
+++ b/webrtc/media/media.gyp
@@ -0,0 +1,291 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+
+{
+  'includes': [ '../build/common.gypi', ],
+  'targets': [
+    {
+      'target_name': 'rtc_media',
+      'type': 'static_library',
+      'dependencies': [
+        '<(webrtc_root)/base/base.gyp:rtc_base',
+        '<(webrtc_root)/common.gyp:webrtc_common',
+        '<(webrtc_root)/modules/modules.gyp:video_render_module',
+        '<(webrtc_root)/webrtc.gyp:webrtc',
+        '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine',
+        '<(webrtc_root)/sound/sound.gyp:rtc_sound',
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
+        '<(webrtc_root)/libjingle/xmllite/xmllite.gyp:rtc_xmllite',
+        '<(webrtc_root)/libjingle/xmpp/xmpp.gyp:rtc_xmpp',
+        '<(webrtc_root)/p2p/p2p.gyp:rtc_p2p',
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          '<(libyuv_dir)/include',
+        ],
+      },
+      'sources': [
+        'base/audioframe.h',
+        'base/audiorenderer.h',
+        'base/capturemanager.cc',
+        'base/capturemanager.h',
+        'base/capturerenderadapter.cc',
+        'base/capturerenderadapter.h',
+        'base/codec.cc',
+        'base/codec.h',
+        'base/constants.cc',
+        'base/constants.h',
+        'base/cpuid.cc',
+        'base/cpuid.h',
+        'base/cryptoparams.h',
+        'base/device.h',
+        'base/fakescreencapturerfactory.h',
+        'base/hybriddataengine.h',
+        'base/mediachannel.h',
+        'base/mediacommon.h',
+        'base/mediaengine.cc',
+        'base/mediaengine.h',
+        'base/rtpdataengine.cc',
+        'base/rtpdataengine.h',
+        'base/rtpdump.cc',
+        'base/rtpdump.h',
+        'base/rtputils.cc',
+        'base/rtputils.h',
+        'base/screencastid.h',
+        'base/streamparams.cc',
+        'base/streamparams.h',
+        'base/turnutils.cc',
+        'base/turnutils.h',
+        'base/videoadapter.cc',
+        'base/videoadapter.h',
+        'base/videocapturer.cc',
+        'base/videocapturer.h',
+        'base/videocapturerfactory.h',
+        'base/videocommon.cc',
+        'base/videocommon.h',
+        'base/videoframe.cc',
+        'base/videoframe.h',
+        'base/videoframefactory.cc',
+        'base/videoframefactory.h',
+        'base/videorenderer.h',
+        'base/yuvframegenerator.cc',
+        'base/yuvframegenerator.h',
+        'devices/deviceinfo.h',
+        'devices/devicemanager.cc',
+        'devices/devicemanager.h',
+        'devices/dummydevicemanager.h',
+        'devices/filevideocapturer.cc',
+        'devices/filevideocapturer.h',
+        'devices/videorendererfactory.h',
+        'devices/yuvframescapturer.cc',
+        'devices/yuvframescapturer.h',
+        'sctp/sctpdataengine.cc',
+        'sctp/sctpdataengine.h',
+        'webrtc/nullwebrtcvideoengine.h',
+        'webrtc/simulcast.cc',
+        'webrtc/simulcast.h',
+        'webrtc/webrtccommon.h',
+        'webrtc/webrtcmediaengine.cc',
+        'webrtc/webrtcmediaengine.h',
+        'webrtc/webrtcmediaengine.cc',
+        'webrtc/webrtcvideocapturer.cc',
+        'webrtc/webrtcvideocapturer.h',
+        'webrtc/webrtcvideocapturerfactory.h',
+        'webrtc/webrtcvideocapturerfactory.cc',
+        'webrtc/webrtcvideodecoderfactory.h',
+        'webrtc/webrtcvideoencoderfactory.h',
+        'webrtc/webrtcvideoengine2.cc',
+        'webrtc/webrtcvideoengine2.h',
+        'webrtc/webrtcvideoframe.cc',
+        'webrtc/webrtcvideoframe.h',
+        'webrtc/webrtcvideoframefactory.cc',
+        'webrtc/webrtcvideoframefactory.h',
+        'webrtc/webrtcvoe.h',
+        'webrtc/webrtcvoiceengine.cc',
+        'webrtc/webrtcvoiceengine.h',
+      ],
+      # TODO(kjellander): Make the code compile without disabling these flags.
+      # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
+      'cflags': [
+        '-Wno-deprecated-declarations',
+      ],
+      'cflags!': [
+        '-Wextra',
+      ],
+      'cflags_cc!': [
+        '-Wnon-virtual-dtor',
+        '-Woverloaded-virtual',
+      ],
+      'msvs_disabled_warnings': [
+        4245,  # conversion from 'int' to 'size_t', signed/unsigned mismatch.
+        4267,  # conversion from 'size_t' to 'int', possible loss of data.
+        4389,  # signed/unsigned mismatch.
+      ],
+      'conditions': [
+        ['build_libyuv==1', {
+          'dependencies': ['<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',],
+        }],
+        ['build_usrsctp==1', {
+          'include_dirs': [
+            # TODO(jiayl): move this into the direct_dependent_settings of
+            # usrsctp.gyp.
+            '<(DEPTH)/third_party/usrsctp/usrsctplib',
+          ],
+          'dependencies': [
+            '<(DEPTH)/third_party/usrsctp/usrsctp.gyp:usrsctplib',
+          ],
+        }],
+        ['build_with_chromium==1', {
+          'dependencies': [
+            '<(webrtc_root)/modules/modules.gyp:video_capture',
+            '<(webrtc_root)/modules/modules.gyp:video_render',
+          ],
+        }, {
+          'defines': [
+            'HAVE_WEBRTC_VIDEO',
+            'HAVE_WEBRTC_VOICE',
+          ],
+          'direct_dependent_settings': {
+            'defines': [
+              'HAVE_WEBRTC_VIDEO',
+              'HAVE_WEBRTC_VOICE',
+            ],
+          },
+          'dependencies': [
+            '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
+            '<(webrtc_root)/modules/modules.gyp:video_render_module_internal_impl',
+          ],
+        }],
+        ['OS=="linux"', {
+          'sources': [
+            'devices/libudevsymboltable.cc',
+            'devices/libudevsymboltable.h',
+            'devices/linuxdeviceinfo.cc',
+            'devices/linuxdevicemanager.cc',
+            'devices/linuxdevicemanager.h',
+            'devices/v4llookup.cc',
+            'devices/v4llookup.h',
+          ],
+          'conditions': [
+            ['use_gtk==1', {
+              'sources': [
+                'devices/gtkvideorenderer.cc',
+                'devices/gtkvideorenderer.h',
+              ],
+              'cflags': [
+                '<!@(pkg-config --cflags gobject-2.0 gthread-2.0 gtk+-2.0)',
+              ],
+            }],
+          ],
+          'include_dirs': [
+            'third_party/libudev'
+          ],
+          'libraries': [
+            '-lrt',
+          ],
+        }],
+        ['OS=="win"', {
+          'sources': [
+            'devices/gdivideorenderer.cc',
+            'devices/gdivideorenderer.h',
+            'devices/win32deviceinfo.cc',
+            'devices/win32devicemanager.cc',
+            'devices/win32devicemanager.h',
+          ],
+          'msvs_settings': {
+            'VCLibrarianTool': {
+              'AdditionalDependencies': [
+                'd3d9.lib',
+                'gdi32.lib',
+                'strmiids.lib',
+                'winmm.lib',
+              ],
+            },
+          },
+        }],
+        ['OS=="mac"', {
+          'sources': [
+            'devices/macdeviceinfo.cc',
+            'devices/macdevicemanager.cc',
+            'devices/macdevicemanager.h',
+            'devices/macdevicemanagermm.mm',
+          ],
+          'conditions': [
+            ['target_arch=="ia32"', {
+              'sources': [
+                'devices/carbonvideorenderer.cc',
+                'devices/carbonvideorenderer.h',
+              ],
+              'link_settings': {
+                'xcode_settings': {
+                  'OTHER_LDFLAGS': [
+                    '-framework Carbon',
+                  ],
+                },
+              },
+            }],
+          ],
+          'xcode_settings': {
+            'WARNING_CFLAGS': [
+              # TODO(ronghuawu): Update macdevicemanager.cc to stop using
+              # deprecated functions and remove this flag.
+              '-Wno-deprecated-declarations',
+            ],
+            # Disable partial availability warning to prevent errors
+            # in macdevicemanagermm.mm using AVFoundation.
+            # https://code.google.com/p/webrtc/issues/detail?id=4695
+            'WARNING_CFLAGS!': ['-Wpartial-availability'],
+          },
+          'link_settings': {
+            'xcode_settings': {
+              'OTHER_LDFLAGS': [
+                '-weak_framework AVFoundation',
+                '-framework Cocoa',
+                '-framework CoreAudio',
+                '-framework CoreVideo',
+                '-framework OpenGL',
+                '-framework QTKit',
+              ],
+            },
+          },
+        }],
+        ['OS=="ios"', {
+          'sources': [
+            'devices/mobiledevicemanager.cc',
+          ],
+          'include_dirs': [
+            # TODO(sjlee) Remove when vp8 is building for iOS.  vp8 pulls in
+            # libjpeg which pulls in libyuv which currently disabled.
+            '../../third_party/libyuv/include',
+          ],
+          # TODO(kjellander): Make the code compile without disabling these.
+          # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
+          'cflags': [
+            '-Wno-unused-const-variable',
+          ],
+          'xcode_settings': {
+            'WARNING_CFLAGS': [
+              '-Wno-unused-const-variable',
+            ],
+          },
+        }],
+        ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', {
+          'defines': [
+            'CARBON_DEPRECATED=YES',
+          ],
+        }],
+        ['OS=="android"', {
+          'sources': [
+            'devices/mobiledevicemanager.cc',
+          ],
+        }],
+      ],
+    },  # target rtc_media
+  ],  # targets.
+}
diff --git a/webrtc/media/media_tests.gypi b/webrtc/media/media_tests.gypi
new file mode 100644
index 0000000..fce1e00
--- /dev/null
+++ b/webrtc/media/media_tests.gypi
@@ -0,0 +1,172 @@
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+
+{
+  'includes': [ '../build/common.gypi', ],
+  'targets': [
+    {
+      'target_name': 'rtc_unittest_main',
+      'type': 'static_library',
+      'dependencies': [
+        '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          '<(libyuv_dir)/include',
+          '<(DEPTH)/testing/gtest/include',
+          '<(DEPTH)/testing/gtest',
+        ],
+      },
+      'conditions': [
+        ['build_libyuv==1', {
+          'dependencies': ['<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',],
+        }],
+        ['OS=="ios"', {
+          # TODO(kjellander): Make the code compile without disabling these.
+          # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
+          'cflags': [
+            '-Wno-unused-variable',
+          ],
+          'xcode_settings': {
+            'WARNING_CFLAGS': [
+              '-Wno-unused-variable',
+            ],
+          },
+        }],
+      ],
+      'include_dirs': [
+         '<(DEPTH)/testing/gtest/include',
+         '<(DEPTH)/testing/gtest',
+       ],
+      'sources': [
+        'base/fakecapturemanager.h',
+        'base/fakemediaengine.h',
+        'base/fakenetworkinterface.h',
+        'base/fakertp.h',
+        'base/fakevideocapturer.h',
+        'base/fakevideorenderer.h',
+        'base/testutils.cc',
+        'base/testutils.h',
+        'devices/fakedevicemanager.h',
+        'webrtc/fakewebrtccall.cc',
+        'webrtc/fakewebrtccall.h',
+        'webrtc/fakewebrtccommon.h',
+        'webrtc/fakewebrtcdeviceinfo.h',
+        'webrtc/fakewebrtcvcmfactory.h',
+        'webrtc/fakewebrtcvideocapturemodule.h',
+        'webrtc/fakewebrtcvideoengine.h',
+        'webrtc/fakewebrtcvoiceengine.h',
+      ],
+      # TODO(kjellander): Make the code compile without disabling these flags.
+      # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
+      'cflags_cc!': [
+        '-Wnon-virtual-dtor',
+      ],
+    },  # target rtc_unittest_main
+    {
+      'target_name': 'libjingle_media_unittest',
+      'type': 'executable',
+      'dependencies': [
+        '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
+        '<(webrtc_root)/media/media.gyp:rtc_media',
+        'rtc_unittest_main',
+      ],
+      'sources': [
+        'base/capturemanager_unittest.cc',
+        'base/codec_unittest.cc',
+        'base/rtpdataengine_unittest.cc',
+        'base/rtpdump_unittest.cc',
+        'base/rtputils_unittest.cc',
+        'base/streamparams_unittest.cc',
+        'base/turnutils_unittest.cc',
+        'base/videoadapter_unittest.cc',
+        'base/videocapturer_unittest.cc',
+        'base/videocommon_unittest.cc',
+        'base/videoengine_unittest.h',
+        'base/videoframe_unittest.h',
+        'devices/dummydevicemanager_unittest.cc',
+        'devices/filevideocapturer_unittest.cc',
+        'sctp/sctpdataengine_unittest.cc',
+        'webrtc/nullwebrtcvideoengine_unittest.cc',
+        'webrtc/simulcast_unittest.cc',
+        'webrtc/webrtcmediaengine_unittest.cc',
+        'webrtc/webrtcvideocapturer_unittest.cc',
+        'webrtc/webrtcvideoframe_unittest.cc',
+        'webrtc/webrtcvideoframefactory_unittest.cc',
+        # Disabled because some tests fail.
+        # TODO(ronghuawu): Reenable these tests.
+        # 'devices/devicemanager_unittest.cc',
+        'webrtc/webrtcvideoengine2_unittest.cc',
+        'webrtc/webrtcvoiceengine_unittest.cc',
+      ],
+      # TODO(kjellander): Make the code compile without disabling these flags.
+      # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
+      'cflags': [
+        '-Wno-sign-compare',
+      ],
+      'cflags_cc!': [
+        '-Wnon-virtual-dtor',
+        '-Woverloaded-virtual',
+      ],
+      'msvs_disabled_warnings': [
+        4245,  # conversion from 'int' to 'uint32_t', signed/unsigned mismatch.
+        4389,  # signed/unsigned mismatch.
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'conditions': [
+            ['use_openssl==0', {
+              'dependencies': [
+                '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
+                '<(DEPTH)/third_party/nss/nss.gyp:nspr',
+                '<(DEPTH)/third_party/nss/nss.gyp:nss',
+              ],
+            }],
+          ],
+          'msvs_settings': {
+            'VCLinkerTool': {
+              'AdditionalDependencies': [
+                # TODO(ronghuawu): Since we've included strmiids in
+                # libjingle_media target, we shouldn't need this here.
+                # Find out why it doesn't work without this.
+                'strmiids.lib',
+              ],
+            },
+          },
+        }],
+        ['OS=="win" and clang==1', {
+          'msvs_settings': {
+            'VCCLCompilerTool': {
+              'AdditionalOptions': [
+                # Disable warnings failing when compiling with Clang on Windows.
+                # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
+                '-Wno-sign-compare',
+                '-Wno-unused-function',
+              ],
+            },
+          },
+        },],
+        ['clang==1', {
+          # TODO(kjellander): Make the code compile without disabling these.
+          # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
+          'cflags!': [
+            '-Wextra',
+          ],
+          'xcode_settings': {
+            'WARNING_CFLAGS!': ['-Wextra'],
+          },
+        }],
+        ['OS=="ios"', {
+          'sources!': [
+            'sctp/sctpdataengine_unittest.cc',
+          ],
+        }],
+      ],
+    },  # target rtc_media_unittests
+  ],
+}
diff --git a/talk/media/sctp/sctpdataengine.cc b/webrtc/media/sctp/sctpdataengine.cc
similarity index 98%
rename from talk/media/sctp/sctpdataengine.cc
rename to webrtc/media/sctp/sctpdataengine.cc
index 3753cd2..4cd39e9 100644
--- a/talk/media/sctp/sctpdataengine.cc
+++ b/webrtc/media/sctp/sctpdataengine.cc
@@ -1,6 +1,6 @@
 /*
  * libjingle
- * Copyright 2012 Google Inc. and Robin Seggelmann
+ * Copyright 2012 Google Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -25,22 +25,22 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/sctp/sctpdataengine.h"
+#include "webrtc/media/sctp/sctpdataengine.h"
 
 #include <stdarg.h>
 #include <stdio.h>
 #include <sstream>
 #include <vector>
 
-#include "talk/media/base/codec.h"
-#include "talk/media/base/constants.h"
-#include "talk/media/base/streamparams.h"
 #include "usrsctplib/usrsctp.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/helpers.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/safe_conversions.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/streamparams.h"
 
 namespace {
 typedef cricket::SctpDataMediaChannel::StreamSet StreamSet;
@@ -77,7 +77,7 @@
     MAKEFLAG(SCTP_STREAM_CHANGE_DENIED)
   };
 #undef MAKEFLAG
-  for (int i = 0; i < arraysize(flaginfo); ++i) {
+  for (uint32_t i = 0; i < arraysize(flaginfo); ++i) {
     if (flags & flaginfo[i].value) {
       if (!first) result << " | ";
       result << flaginfo[i].name;
diff --git a/talk/media/sctp/sctpdataengine.h b/webrtc/media/sctp/sctpdataengine.h
similarity index 96%
rename from talk/media/sctp/sctpdataengine.h
rename to webrtc/media/sctp/sctpdataengine.h
index 4bc5f0b..cbb470b 100644
--- a/talk/media/sctp/sctpdataengine.h
+++ b/webrtc/media/sctp/sctpdataengine.h
@@ -1,6 +1,6 @@
 /*
  * libjingle
- * Copyright 2012 Google Inc. and Robin Seggelmann
+ * Copyright 2012 Google Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_SCTP_SCTPDATAENGINE_H_
-#define TALK_MEDIA_SCTP_SCTPDATAENGINE_H_
+#ifndef WEBRTC_MEDIA_SCTP_SCTPDATAENGINE_H_
+#define WEBRTC_MEDIA_SCTP_SCTPDATAENGINE_H_
 
 #include <errno.h>
 #include <string>
@@ -41,11 +41,11 @@
 };
 }  // namespace cricket
 
-#include "talk/media/base/codec.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/mediaengine.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/mediaengine.h"
 
 // Defined by "usrsctplib/usrsctp.h"
 struct sockaddr_conn;
@@ -253,4 +253,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_SCTP_SCTPDATAENGINE_H_
+#endif  // WEBRTC_MEDIA_SCTP_SCTPDATAENGINE_H_
diff --git a/talk/media/sctp/sctpdataengine_unittest.cc b/webrtc/media/sctp/sctpdataengine_unittest.cc
similarity index 98%
rename from talk/media/sctp/sctpdataengine_unittest.cc
rename to webrtc/media/sctp/sctpdataengine_unittest.cc
index d673c69..b2e4e05 100644
--- a/talk/media/sctp/sctpdataengine_unittest.cc
+++ b/webrtc/media/sctp/sctpdataengine_unittest.cc
@@ -31,9 +31,6 @@
 #include <string>
 #include <vector>
 
-#include "talk/media/base/constants.h"
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/sctp/sctpdataengine.h"
 #include "webrtc/base/bind.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/criticalsection.h"
@@ -44,13 +41,16 @@
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/ssladapter.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/sctp/sctpdataengine.h"
 
 enum {
   MSG_PACKET = 1,
 };
 
 // Fake NetworkInterface that sends/receives sctp packets.  The one in
-// talk/media/base/fakenetworkinterface.h only works with rtp/rtcp.
+// webrtc/media/base/fakenetworkinterface.h only works with rtp/rtcp.
 class SctpFakeNetworkInterface : public cricket::MediaChannel::NetworkInterface,
                                  public rtc::MessageHandler {
  public:
diff --git a/talk/media/webrtc/constants.h b/webrtc/media/webrtc/constants.h
old mode 100755
new mode 100644
similarity index 92%
rename from talk/media/webrtc/constants.h
rename to webrtc/media/webrtc/constants.h
index ff73faa..63cbfc3
--- a/talk/media/webrtc/constants.h
+++ b/webrtc/media/webrtc/constants.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTC_CONSTANTS_H_
-#define TALK_MEDIA_WEBRTC_CONSTANTS_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_CONSTANTS_H_
+#define WEBRTC_MEDIA_WEBRTC_CONSTANTS_H_
 
 namespace cricket {
 
@@ -41,4 +41,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_CONSTANTS_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_CONSTANTS_H_
diff --git a/talk/media/webrtc/fakewebrtccall.cc b/webrtc/media/webrtc/fakewebrtccall.cc
similarity index 99%
rename from talk/media/webrtc/fakewebrtccall.cc
rename to webrtc/media/webrtc/fakewebrtccall.cc
index d50a53c..fda94aa 100644
--- a/talk/media/webrtc/fakewebrtccall.cc
+++ b/webrtc/media/webrtc/fakewebrtccall.cc
@@ -25,15 +25,15 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/webrtc/fakewebrtccall.h"
+#include "webrtc/media/webrtc/fakewebrtccall.h"
 
 #include <algorithm>
 #include <utility>
 
-#include "talk/media/base/rtputils.h"
+#include "webrtc/audio/audio_sink.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/gunit.h"
-#include "webrtc/audio/audio_sink.h"
+#include "webrtc/media/base/rtputils.h"
 
 namespace cricket {
 FakeAudioSendStream::FakeAudioSendStream(
diff --git a/talk/media/webrtc/fakewebrtccall.h b/webrtc/media/webrtc/fakewebrtccall.h
similarity index 98%
rename from talk/media/webrtc/fakewebrtccall.h
rename to webrtc/media/webrtc/fakewebrtccall.h
index ab1e3b6..46d2ea3 100644
--- a/talk/media/webrtc/fakewebrtccall.h
+++ b/webrtc/media/webrtc/fakewebrtccall.h
@@ -34,14 +34,14 @@
 //   webrtc::VideoSendStream
 //   webrtc::VideoReceiveStream
 
-#ifndef TALK_MEDIA_WEBRTC_FAKEWEBRTCCALL_H_
-#define TALK_MEDIA_WEBRTC_FAKEWEBRTCCALL_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCCALL_H_
+#define WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCCALL_H_
 
 #include <vector>
 
-#include "webrtc/call.h"
 #include "webrtc/audio_receive_stream.h"
 #include "webrtc/audio_send_stream.h"
+#include "webrtc/call.h"
 #include "webrtc/video_frame.h"
 #include "webrtc/video_receive_stream.h"
 #include "webrtc/video_send_stream.h"
diff --git a/talk/media/webrtc/fakewebrtccommon.h b/webrtc/media/webrtc/fakewebrtccommon.h
similarity index 93%
rename from talk/media/webrtc/fakewebrtccommon.h
rename to webrtc/media/webrtc/fakewebrtccommon.h
index 4281528..76f50bf 100644
--- a/talk/media/webrtc/fakewebrtccommon.h
+++ b/webrtc/media/webrtc/fakewebrtccommon.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_SESSION_PHONE_FAKEWEBRTCCOMMON_H_
-#define TALK_SESSION_PHONE_FAKEWEBRTCCOMMON_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCCOMMON_H_
+#define WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCCOMMON_H_
 
 #include "webrtc/base/common.h"
 
@@ -56,4 +56,4 @@
 #define WEBRTC_VOID_FUNC(method, args) void method args override
 }  // namespace cricket
 
-#endif  // TALK_SESSION_PHONE_FAKEWEBRTCCOMMON_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCCOMMON_H_
diff --git a/talk/media/webrtc/fakewebrtcdeviceinfo.h b/webrtc/media/webrtc/fakewebrtcdeviceinfo.h
similarity index 95%
rename from talk/media/webrtc/fakewebrtcdeviceinfo.h
rename to webrtc/media/webrtc/fakewebrtcdeviceinfo.h
index ad5d5f5..85658f6 100644
--- a/talk/media/webrtc/fakewebrtcdeviceinfo.h
+++ b/webrtc/media/webrtc/fakewebrtcdeviceinfo.h
@@ -25,13 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_SESSION_PHONE_FAKEWEBRTCDEVICEINFO_H_
-#define TALK_SESSION_PHONE_FAKEWEBRTCDEVICEINFO_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCDEVICEINFO_H_
+#define WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCDEVICEINFO_H_
 
 #include <vector>
 
-#include "talk/media/webrtc/webrtcvideocapturer.h"
 #include "webrtc/base/stringutils.h"
+#include "webrtc/media/webrtc/webrtcvideocapturer.h"
 
 // Fake class for mocking out webrtc::VideoCaptureModule::DeviceInfo.
 class FakeWebRtcDeviceInfo : public webrtc::VideoCaptureModule::DeviceInfo {
@@ -122,4 +122,4 @@
   std::vector<Device> devices_;
 };
 
-#endif  // TALK_SESSION_PHONE_FAKEWEBRTCDEVICEINFO_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCDEVICEINFO_H_
diff --git a/talk/media/webrtc/fakewebrtcvcmfactory.h b/webrtc/media/webrtc/fakewebrtcvcmfactory.h
similarity index 89%
rename from talk/media/webrtc/fakewebrtcvcmfactory.h
rename to webrtc/media/webrtc/fakewebrtcvcmfactory.h
index 40009cc..30b1299 100644
--- a/talk/media/webrtc/fakewebrtcvcmfactory.h
+++ b/webrtc/media/webrtc/fakewebrtcvcmfactory.h
@@ -25,13 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_SESSION_PHONE_FAKEWEBRTCVCMFACTORY_H_
-#define TALK_SESSION_PHONE_FAKEWEBRTCVCMFACTORY_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVCMFACTORY_H_
+#define WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVCMFACTORY_H_
 
 #include <vector>
 
-#include "talk/media/webrtc/fakewebrtcvideocapturemodule.h"
-#include "talk/media/webrtc/webrtcvideocapturer.h"
+#include "webrtc/media/webrtc/fakewebrtcvideocapturemodule.h"
+#include "webrtc/media/webrtc/webrtcvideocapturer.h"
 
 // Factory class to allow the fakes above to be injected into
 // WebRtcVideoCapturer.
@@ -62,4 +62,4 @@
     factory_->OnDestroyed(this);
 }
 
-#endif  // TALK_SESSION_PHONE_FAKEWEBRTCVCMFACTORY_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVCMFACTORY_H_
diff --git a/talk/media/webrtc/fakewebrtcvideocapturemodule.h b/webrtc/media/webrtc/fakewebrtcvideocapturemodule.h
similarity index 92%
rename from talk/media/webrtc/fakewebrtcvideocapturemodule.h
rename to webrtc/media/webrtc/fakewebrtcvideocapturemodule.h
index 7540fcf..6a90c4e 100644
--- a/talk/media/webrtc/fakewebrtcvideocapturemodule.h
+++ b/webrtc/media/webrtc/fakewebrtcvideocapturemodule.h
@@ -25,14 +25,14 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_SESSION_PHONE_FAKEWEBRTCVIDEOCAPTUREMODULE_H_
-#define TALK_SESSION_PHONE_FAKEWEBRTCVIDEOCAPTUREMODULE_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVIDEOCAPTUREMODULE_H_
+#define WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVIDEOCAPTUREMODULE_H_
 
 #include <vector>
 
-#include "talk/media/base/testutils.h"
-#include "talk/media/webrtc/fakewebrtcdeviceinfo.h"
-#include "talk/media/webrtc/webrtcvideocapturer.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/webrtc/fakewebrtcdeviceinfo.h"
+#include "webrtc/media/webrtc/webrtcvideocapturer.h"
 
 class FakeWebRtcVcmFactory;
 
@@ -136,4 +136,4 @@
   int delay_;
 };
 
-#endif  // TALK_SESSION_PHONE_FAKEWEBRTCVIDEOCAPTUREMODULE_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVIDEOCAPTUREMODULE_H_
diff --git a/talk/media/webrtc/fakewebrtcvideoengine.h b/webrtc/media/webrtc/fakewebrtcvideoengine.h
similarity index 95%
rename from talk/media/webrtc/fakewebrtcvideoengine.h
rename to webrtc/media/webrtc/fakewebrtcvideoengine.h
index aebd843..fe17b97 100644
--- a/talk/media/webrtc/fakewebrtcvideoengine.h
+++ b/webrtc/media/webrtc/fakewebrtcvideoengine.h
@@ -25,22 +25,22 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTC_FAKEWEBRTCVIDEOENGINE_H_
-#define TALK_MEDIA_WEBRTC_FAKEWEBRTCVIDEOENGINE_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVIDEOENGINE_H_
+#define WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVIDEOENGINE_H_
 
 #include <map>
 #include <set>
 #include <vector>
 
-#include "talk/media/base/codec.h"
-#include "talk/media/webrtc/fakewebrtccommon.h"
-#include "talk/media/webrtc/webrtcvideodecoderfactory.h"
-#include "talk/media/webrtc/webrtcvideoencoderfactory.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/base/thread_annotations.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/webrtc/fakewebrtccommon.h"
+#include "webrtc/media/webrtc/webrtcvideodecoderfactory.h"
+#include "webrtc/media/webrtc/webrtcvideoencoderfactory.h"
 #include "webrtc/modules/video_coding/include/video_error_codes.h"
 #include "webrtc/video_decoder.h"
 #include "webrtc/video_encoder.h"
@@ -250,4 +250,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_FAKEWEBRTCVIDEOENGINE_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVIDEOENGINE_H_
diff --git a/talk/media/webrtc/fakewebrtcvoiceengine.h b/webrtc/media/webrtc/fakewebrtcvoiceengine.h
similarity index 98%
rename from talk/media/webrtc/fakewebrtcvoiceengine.h
rename to webrtc/media/webrtc/fakewebrtcvoiceengine.h
index 4c6c016..aedbe84 100644
--- a/talk/media/webrtc/fakewebrtcvoiceengine.h
+++ b/webrtc/media/webrtc/fakewebrtcvoiceengine.h
@@ -25,22 +25,22 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_
-#define TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVOICEENGINE_H_
+#define WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVOICEENGINE_H_
 
 #include <list>
 #include <map>
 #include <vector>
 
-#include "talk/media/base/codec.h"
-#include "talk/media/base/rtputils.h"
-#include "talk/media/webrtc/fakewebrtccommon.h"
-#include "talk/media/webrtc/webrtcvoe.h"
 #include "webrtc/base/basictypes.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/config.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/rtputils.h"
+#include "webrtc/media/webrtc/fakewebrtccommon.h"
+#include "webrtc/media/webrtc/webrtcvoe.h"
 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h"
 #include "webrtc/modules/audio_processing/include/audio_processing.h"
 
@@ -822,4 +822,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_FAKEWEBRTCVOICEENGINE_H_
diff --git a/talk/media/webrtc/nullwebrtcvideoengine.h b/webrtc/media/webrtc/nullwebrtcvideoengine.h
similarity index 90%
rename from talk/media/webrtc/nullwebrtcvideoengine.h
rename to webrtc/media/webrtc/nullwebrtcvideoengine.h
index 8af83a8..4f9d2d9 100644
--- a/talk/media/webrtc/nullwebrtcvideoengine.h
+++ b/webrtc/media/webrtc/nullwebrtcvideoengine.h
@@ -25,13 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTC_NULLWEBRTCVIDEOENGINE_H_
-#define TALK_MEDIA_WEBRTC_NULLWEBRTCVIDEOENGINE_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_NULLWEBRTCVIDEOENGINE_H_
+#define WEBRTC_MEDIA_WEBRTC_NULLWEBRTCVIDEOENGINE_H_
 
 #include <vector>
 
-#include "talk/media/base/mediachannel.h"
-#include "talk/media/base/mediaengine.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/mediaengine.h"
 
 namespace webrtc {
 
@@ -78,4 +78,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_NULLWEBRTCVIDEOENGINE_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_NULLWEBRTCVIDEOENGINE_H_
diff --git a/talk/media/webrtc/nullwebrtcvideoengine_unittest.cc b/webrtc/media/webrtc/nullwebrtcvideoengine_unittest.cc
similarity index 95%
rename from talk/media/webrtc/nullwebrtcvideoengine_unittest.cc
rename to webrtc/media/webrtc/nullwebrtcvideoengine_unittest.cc
index 34e4af5..8bfc200 100644
--- a/talk/media/webrtc/nullwebrtcvideoengine_unittest.cc
+++ b/webrtc/media/webrtc/nullwebrtcvideoengine_unittest.cc
@@ -27,8 +27,8 @@
 
 #include "testing/gtest/include/gtest/gtest.h"
 
-#include "talk/media/webrtc/nullwebrtcvideoengine.h"
-#include "talk/media/webrtc/webrtcvoiceengine.h"
+#include "webrtc/media/webrtc/nullwebrtcvideoengine.h"
+#include "webrtc/media/webrtc/webrtcvoiceengine.h"
 
 namespace cricket {
 
diff --git a/talk/media/webrtc/simulcast.cc b/webrtc/media/webrtc/simulcast.cc
old mode 100755
new mode 100644
similarity index 97%
rename from talk/media/webrtc/simulcast.cc
rename to webrtc/media/webrtc/simulcast.cc
index b67a363..3619bd2
--- a/talk/media/webrtc/simulcast.cc
+++ b/webrtc/media/webrtc/simulcast.cc
@@ -27,11 +27,11 @@
 
 #include <stdio.h>
 
-#include "talk/media/base/streamparams.h"
-#include "talk/media/webrtc/simulcast.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/common.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/base/streamparams.h"
+#include "webrtc/media/webrtc/simulcast.h"
 #include "webrtc/system_wrappers/include/field_trial.h"
 
 namespace cricket {
@@ -95,7 +95,7 @@
 int FindSimulcastFormatIndex(int width, int height) {
   MaybeExchangeWidthHeight(&width, &height);
 
-  for (int i = 0; i < arraysize(kSimulcastFormats); ++i) {
+  for (uint32_t i = 0; i < arraysize(kSimulcastFormats); ++i) {
     if (width >= kSimulcastFormats[i].width &&
         height >= kSimulcastFormats[i].height) {
       return i;
@@ -107,7 +107,7 @@
 int FindSimulcastFormatIndex(int width, int height, size_t max_layers) {
   MaybeExchangeWidthHeight(&width, &height);
 
-  for (int i = 0; i < arraysize(kSimulcastFormats); ++i) {
+  for (uint32_t i = 0; i < arraysize(kSimulcastFormats); ++i) {
     if (width >= kSimulcastFormats[i].width &&
         height >= kSimulcastFormats[i].height &&
         max_layers == kSimulcastFormats[i].max_layers) {
diff --git a/talk/media/webrtc/simulcast.h b/webrtc/media/webrtc/simulcast.h
old mode 100755
new mode 100644
similarity index 95%
rename from talk/media/webrtc/simulcast.h
rename to webrtc/media/webrtc/simulcast.h
index 68d0aae..c9a6881
--- a/talk/media/webrtc/simulcast.h
+++ b/webrtc/media/webrtc/simulcast.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTC_SIMULCAST_H_
-#define TALK_MEDIA_WEBRTC_SIMULCAST_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_SIMULCAST_H_
+#define WEBRTC_MEDIA_WEBRTC_SIMULCAST_H_
 
 #include <vector>
 
@@ -71,4 +71,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_SIMULCAST_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_SIMULCAST_H_
diff --git a/talk/media/webrtc/simulcast_unittest.cc b/webrtc/media/webrtc/simulcast_unittest.cc
similarity index 98%
rename from talk/media/webrtc/simulcast_unittest.cc
rename to webrtc/media/webrtc/simulcast_unittest.cc
index e6b97f7..01fb8af 100644
--- a/talk/media/webrtc/simulcast_unittest.cc
+++ b/webrtc/media/webrtc/simulcast_unittest.cc
@@ -27,8 +27,8 @@
 
 #include <string>
 
-#include "talk/media/webrtc/simulcast.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/media/webrtc/simulcast.h"
 
 namespace cricket {
 
diff --git a/talk/media/webrtc/webrtccommon.h b/webrtc/media/webrtc/webrtccommon.h
similarity index 96%
rename from talk/media/webrtc/webrtccommon.h
rename to webrtc/media/webrtc/webrtccommon.h
index c83f29d..d4c90f0 100644
--- a/talk/media/webrtc/webrtccommon.h
+++ b/webrtc/media/webrtc/webrtccommon.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTCCOMMON_H_
-#define TALK_MEDIA_WEBRTCCOMMON_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCCOMMON_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCCOMMON_H_
 
 #include "webrtc/common_types.h"
 
@@ -72,4 +72,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTCCOMMON_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCCOMMON_H_
diff --git a/talk/media/webrtc/webrtcmediaengine.cc b/webrtc/media/webrtc/webrtcmediaengine.cc
similarity index 96%
rename from talk/media/webrtc/webrtcmediaengine.cc
rename to webrtc/media/webrtc/webrtcmediaengine.cc
index a014a0f..53162f0 100644
--- a/talk/media/webrtc/webrtcmediaengine.cc
+++ b/webrtc/media/webrtc/webrtcmediaengine.cc
@@ -25,16 +25,16 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/webrtc/webrtcmediaengine.h"
+#include "webrtc/media/webrtc/webrtcmediaengine.h"
 
 #include <algorithm>
 
 #ifdef HAVE_WEBRTC_VIDEO
-#include "talk/media/webrtc/webrtcvideoengine2.h"
+#include "webrtc/media/webrtc/webrtcvideoengine2.h"
 #else
-#include "talk/media/webrtc/nullwebrtcvideoengine.h"
+#include "webrtc/media/webrtc/nullwebrtcvideoengine.h"
 #endif
-#include "talk/media/webrtc/webrtcvoiceengine.h"
+#include "webrtc/media/webrtc/webrtcvoiceengine.h"
 
 namespace cricket {
 
diff --git a/talk/media/webrtc/webrtcmediaengine.h b/webrtc/media/webrtc/webrtcmediaengine.h
similarity index 92%
rename from talk/media/webrtc/webrtcmediaengine.h
rename to webrtc/media/webrtc/webrtcmediaengine.h
index 831d072..382ba58 100644
--- a/talk/media/webrtc/webrtcmediaengine.h
+++ b/webrtc/media/webrtc/webrtcmediaengine.h
@@ -25,14 +25,14 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTCMEDIAENGINE_H_
-#define TALK_MEDIA_WEBRTCMEDIAENGINE_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCMEDIAENGINE_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCMEDIAENGINE_H_
 
 #include <string>
 #include <vector>
 
-#include "talk/media/base/mediaengine.h"
 #include "webrtc/config.h"
+#include "webrtc/media/base/mediaengine.h"
 
 namespace webrtc {
 class AudioDeviceModule;
@@ -67,4 +67,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTCMEDIAENGINE_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCMEDIAENGINE_H_
diff --git a/talk/media/webrtc/webrtcmediaengine_unittest.cc b/webrtc/media/webrtc/webrtcmediaengine_unittest.cc
similarity index 99%
rename from talk/media/webrtc/webrtcmediaengine_unittest.cc
rename to webrtc/media/webrtc/webrtcmediaengine_unittest.cc
index 7c80e77..92a569d 100644
--- a/talk/media/webrtc/webrtcmediaengine_unittest.cc
+++ b/webrtc/media/webrtc/webrtcmediaengine_unittest.cc
@@ -27,7 +27,7 @@
 
 #include "testing/gtest/include/gtest/gtest.h"
 
-#include "talk/media/webrtc/webrtcmediaengine.h"
+#include "webrtc/media/webrtc/webrtcmediaengine.h"
 
 namespace cricket {
 namespace {
diff --git a/talk/media/webrtc/webrtcvideocapturer.cc b/webrtc/media/webrtc/webrtcvideocapturer.cc
similarity index 98%
rename from talk/media/webrtc/webrtcvideocapturer.cc
rename to webrtc/media/webrtc/webrtcvideocapturer.cc
index ee4db5b..d152124 100644
--- a/talk/media/webrtc/webrtcvideocapturer.cc
+++ b/webrtc/media/webrtc/webrtcvideocapturer.cc
@@ -25,15 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/webrtc/webrtcvideocapturer.h"
+#include "webrtc/media/webrtc/webrtcvideocapturer.h"
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
 #ifdef HAVE_WEBRTC_VIDEO
-#include "talk/media/webrtc/webrtcvideoframe.h"
-#include "talk/media/webrtc/webrtcvideoframefactory.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/bind.h"
 #include "webrtc/base/checks.h"
@@ -42,6 +40,8 @@
 #include "webrtc/base/safe_conversions.h"
 #include "webrtc/base/thread.h"
 #include "webrtc/base/timeutils.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
+#include "webrtc/media/webrtc/webrtcvideoframefactory.h"
 
 #include "webrtc/base/win32.h"  // Need this to #include the impl files.
 #include "webrtc/modules/video_capture/video_capture_factory.h"
diff --git a/talk/media/webrtc/webrtcvideocapturer.h b/webrtc/media/webrtc/webrtcvideocapturer.h
similarity index 94%
rename from talk/media/webrtc/webrtcvideocapturer.h
rename to webrtc/media/webrtc/webrtcvideocapturer.h
index 591e46f..7e48422 100644
--- a/talk/media/webrtc/webrtcvideocapturer.h
+++ b/webrtc/media/webrtc/webrtcvideocapturer.h
@@ -25,20 +25,20 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTCVIDEOCAPTURER_H_
-#define TALK_MEDIA_WEBRTCVIDEOCAPTURER_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURER_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURER_H_
 
 #ifdef HAVE_WEBRTC_VIDEO
 
 #include <string>
 #include <vector>
 
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/webrtc/webrtcvideoframe.h"
 #include "webrtc/base/asyncinvoker.h"
 #include "webrtc/base/messagehandler.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
 #include "webrtc/modules/video_capture/video_capture.h"
 
 namespace cricket {
@@ -113,4 +113,4 @@
 }  // namespace cricket
 
 #endif  // HAVE_WEBRTC_VIDEO
-#endif  // TALK_MEDIA_WEBRTCVIDEOCAPTURER_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURER_H_
diff --git a/talk/media/webrtc/webrtcvideocapturer_unittest.cc b/webrtc/media/webrtc/webrtcvideocapturer_unittest.cc
similarity index 96%
rename from talk/media/webrtc/webrtcvideocapturer_unittest.cc
rename to webrtc/media/webrtc/webrtcvideocapturer_unittest.cc
index 99eb7f2..24e64e7 100644
--- a/talk/media/webrtc/webrtcvideocapturer_unittest.cc
+++ b/webrtc/media/webrtc/webrtcvideocapturer_unittest.cc
@@ -29,14 +29,14 @@
 
 #include <stdio.h>
 #include <vector>
-#include "talk/media/base/testutils.h"
-#include "talk/media/base/videocommon.h"
-#include "talk/media/webrtc/fakewebrtcvcmfactory.h"
-#include "talk/media/webrtc/webrtcvideocapturer.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/base/thread.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/webrtc/fakewebrtcvcmfactory.h"
+#include "webrtc/media/webrtc/webrtcvideocapturer.h"
 
 using cricket::VideoFormat;
 
diff --git a/talk/media/webrtc/webrtcvideocapturerfactory.cc b/webrtc/media/webrtc/webrtcvideocapturerfactory.cc
old mode 100755
new mode 100644
similarity index 92%
rename from talk/media/webrtc/webrtcvideocapturerfactory.cc
rename to webrtc/media/webrtc/webrtcvideocapturerfactory.cc
index e1466fb..9717e0d
--- a/talk/media/webrtc/webrtcvideocapturerfactory.cc
+++ b/webrtc/media/webrtc/webrtcvideocapturerfactory.cc
@@ -1,6 +1,6 @@
 /*
  * libjingle
- * Copyright 2014 Google Inc.
+ * Copyright 2004 Google Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -25,9 +25,9 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/webrtc/webrtcvideocapturer.h"
-#include "talk/media/webrtc/webrtcvideocapturerfactory.h"
 #include "webrtc/base/scoped_ptr.h"
+#include "webrtc/media/webrtc/webrtcvideocapturer.h"
+#include "webrtc/media/webrtc/webrtcvideocapturerfactory.h"
 
 namespace cricket {
 
diff --git a/talk/media/webrtc/webrtcvideocapturerfactory.h b/webrtc/media/webrtc/webrtcvideocapturerfactory.h
old mode 100755
new mode 100644
similarity index 88%
rename from talk/media/webrtc/webrtcvideocapturerfactory.h
rename to webrtc/media/webrtc/webrtcvideocapturerfactory.h
index 0f7b622..01d207f
--- a/talk/media/webrtc/webrtcvideocapturerfactory.h
+++ b/webrtc/media/webrtc/webrtcvideocapturerfactory.h
@@ -26,10 +26,10 @@
  */
 
 // TODO(pthatcher): Rename file to match class name.
-#ifndef TALK_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURERFACTORY_H_
-#define TALK_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURERFACTORY_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURERFACTORY_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURERFACTORY_H_
 
-#include "talk/media/base/videocapturerfactory.h"
+#include "webrtc/media/base/videocapturerfactory.h"
 
 namespace cricket {
 
@@ -41,4 +41,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURERFACTORY_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURERFACTORY_H_
diff --git a/talk/media/webrtc/webrtcvideochannelfactory.h b/webrtc/media/webrtc/webrtcvideochannelfactory.h
similarity index 91%
rename from talk/media/webrtc/webrtcvideochannelfactory.h
rename to webrtc/media/webrtc/webrtcvideochannelfactory.h
index 646348c..2dd8754 100644
--- a/talk/media/webrtc/webrtcvideochannelfactory.h
+++ b/webrtc/media/webrtc/webrtcvideochannelfactory.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTC_WEBRTCVIDEOCHANNEL_H_
-#define TALK_MEDIA_WEBRTC_WEBRTCVIDEOCHANNEL_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCHANNELFACTORY_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCHANNELFACTORY_H_
 
 namespace cricket {
 class VoiceMediaChannel;
@@ -41,4 +41,4 @@
 };
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_WEBRTCVIDEOCHANNEL_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCHANNELFACTORY_H_
diff --git a/talk/media/webrtc/webrtcvideodecoderfactory.h b/webrtc/media/webrtc/webrtcvideodecoderfactory.h
similarity index 91%
rename from talk/media/webrtc/webrtcvideodecoderfactory.h
rename to webrtc/media/webrtc/webrtcvideodecoderfactory.h
index 6055a23..f2811ad 100644
--- a/talk/media/webrtc/webrtcvideodecoderfactory.h
+++ b/webrtc/media/webrtc/webrtcvideodecoderfactory.h
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTC_WEBRTCVIDEODECODERFACTORY_H_
-#define TALK_MEDIA_WEBRTC_WEBRTCVIDEODECODERFACTORY_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEODECODERFACTORY_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEODECODERFACTORY_H_
 
 #include "webrtc/base/refcount.h"
 #include "webrtc/common_types.h"
@@ -50,4 +50,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_WEBRTCVIDEODECODERFACTORY_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEODECODERFACTORY_H_
diff --git a/talk/media/webrtc/webrtcvideoencoderfactory.h b/webrtc/media/webrtc/webrtcvideoencoderfactory.h
similarity index 92%
rename from talk/media/webrtc/webrtcvideoencoderfactory.h
rename to webrtc/media/webrtc/webrtcvideoencoderfactory.h
index ad681fe..a0a8332 100644
--- a/talk/media/webrtc/webrtcvideoencoderfactory.h
+++ b/webrtc/media/webrtc/webrtcvideoencoderfactory.h
@@ -25,12 +25,12 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTC_WEBRTCVIDEOENCODERFACTORY_H_
-#define TALK_MEDIA_WEBRTC_WEBRTCVIDEOENCODERFACTORY_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOENCODERFACTORY_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOENCODERFACTORY_H_
 
-#include "talk/media/base/codec.h"
 #include "webrtc/base/refcount.h"
 #include "webrtc/common_types.h"
+#include "webrtc/media/base/codec.h"
 
 namespace webrtc {
 class VideoEncoder;
@@ -77,4 +77,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENCODERFACTORY_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOENCODERFACTORY_H_
diff --git a/talk/media/webrtc/webrtcvideoengine2.cc b/webrtc/media/webrtc/webrtcvideoengine2.cc
similarity index 99%
rename from talk/media/webrtc/webrtcvideoengine2.cc
rename to webrtc/media/webrtc/webrtcvideoengine2.cc
index 6f04d96..265aa12 100644
--- a/talk/media/webrtc/webrtcvideoengine2.cc
+++ b/webrtc/media/webrtc/webrtcvideoengine2.cc
@@ -26,26 +26,26 @@
  */
 
 #ifdef HAVE_WEBRTC_VIDEO
-#include "talk/media/webrtc/webrtcvideoengine2.h"
+#include "webrtc/media/webrtc/webrtcvideoengine2.h"
 
 #include <algorithm>
 #include <set>
 #include <string>
 
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videorenderer.h"
-#include "talk/media/webrtc/constants.h"
-#include "talk/media/webrtc/simulcast.h"
-#include "talk/media/webrtc/webrtcmediaengine.h"
-#include "talk/media/webrtc/webrtcvideoencoderfactory.h"
-#include "talk/media/webrtc/webrtcvideoframe.h"
-#include "talk/media/webrtc/webrtcvoiceengine.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/stringutils.h"
 #include "webrtc/base/timeutils.h"
 #include "webrtc/base/trace_event.h"
 #include "webrtc/call.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videorenderer.h"
+#include "webrtc/media/webrtc/constants.h"
+#include "webrtc/media/webrtc/simulcast.h"
+#include "webrtc/media/webrtc/webrtcmediaengine.h"
+#include "webrtc/media/webrtc/webrtcvideoencoderfactory.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
+#include "webrtc/media/webrtc/webrtcvoiceengine.h"
 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
 #include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h"
 #include "webrtc/system_wrappers/include/field_trial.h"
@@ -334,7 +334,7 @@
 }
 }  // namespace
 
-// Constants defined in talk/media/webrtc/constants.h
+// Constants defined in webrtc/media/webrtc/constants.h
 // TODO(pbos): Move these to a separate constants.cc file.
 const int kMinVideoBitrate = 30;
 const int kStartVideoBitrate = 300;
diff --git a/talk/media/webrtc/webrtcvideoengine2.h b/webrtc/media/webrtc/webrtcvideoengine2.h
similarity index 97%
rename from talk/media/webrtc/webrtcvideoengine2.h
rename to webrtc/media/webrtc/webrtcvideoengine2.h
index 7881905..70caef1 100644
--- a/talk/media/webrtc/webrtcvideoengine2.h
+++ b/webrtc/media/webrtc/webrtcvideoengine2.h
@@ -25,23 +25,23 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_
-#define TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_
 
 #include <map>
 #include <string>
 #include <vector>
 
-#include "talk/media/base/mediaengine.h"
-#include "talk/media/webrtc/webrtcvideochannelfactory.h"
-#include "talk/media/webrtc/webrtcvideodecoderfactory.h"
-#include "talk/media/webrtc/webrtcvideoencoderfactory.h"
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/thread_annotations.h"
 #include "webrtc/base/thread_checker.h"
 #include "webrtc/media/base/videosinkinterface.h"
 #include "webrtc/call.h"
+#include "webrtc/media/base/mediaengine.h"
+#include "webrtc/media/webrtc/webrtcvideochannelfactory.h"
+#include "webrtc/media/webrtc/webrtcvideodecoderfactory.h"
+#include "webrtc/media/webrtc/webrtcvideoencoderfactory.h"
 #include "webrtc/transport.h"
 #include "webrtc/video_frame.h"
 #include "webrtc/video_receive_stream.h"
@@ -528,4 +528,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_
diff --git a/talk/media/webrtc/webrtcvideoengine2_unittest.cc b/webrtc/media/webrtc/webrtcvideoengine2_unittest.cc
similarity index 99%
rename from talk/media/webrtc/webrtcvideoengine2_unittest.cc
rename to webrtc/media/webrtc/webrtcvideoengine2_unittest.cc
index 84fe519..7a7c815 100644
--- a/talk/media/webrtc/webrtcvideoengine2_unittest.cc
+++ b/webrtc/media/webrtc/webrtcvideoengine2_unittest.cc
@@ -31,17 +31,17 @@
 #include <map>
 #include <vector>
 
-#include "talk/media/base/testutils.h"
-#include "talk/media/base/videoengine_unittest.h"
-#include "talk/media/webrtc/fakewebrtccall.h"
-#include "talk/media/webrtc/fakewebrtcvideoengine.h"
-#include "talk/media/webrtc/simulcast.h"
-#include "talk/media/webrtc/webrtcvideochannelfactory.h"
-#include "talk/media/webrtc/webrtcvideoengine2.h"
-#include "talk/media/webrtc/webrtcvoiceengine.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/base/stringutils.h"
+#include "webrtc/media/base/testutils.h"
+#include "webrtc/media/base/videoengine_unittest.h"
+#include "webrtc/media/webrtc/fakewebrtccall.h"
+#include "webrtc/media/webrtc/fakewebrtcvideoengine.h"
+#include "webrtc/media/webrtc/simulcast.h"
+#include "webrtc/media/webrtc/webrtcvideochannelfactory.h"
+#include "webrtc/media/webrtc/webrtcvideoengine2.h"
+#include "webrtc/media/webrtc/webrtcvoiceengine.h"
 #include "webrtc/test/field_trial.h"
 #include "webrtc/video_encoder.h"
 
diff --git a/talk/media/webrtc/webrtcvideoframe.cc b/webrtc/media/webrtc/webrtcvideoframe.cc
similarity index 98%
rename from talk/media/webrtc/webrtcvideoframe.cc
rename to webrtc/media/webrtc/webrtcvideoframe.cc
index 9114664..7ef8a55 100644
--- a/talk/media/webrtc/webrtcvideoframe.cc
+++ b/webrtc/media/webrtc/webrtcvideoframe.cc
@@ -25,12 +25,12 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/webrtc/webrtcvideoframe.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
 
 #include "libyuv/convert.h"
-#include "talk/media/base/videocapturer.h"
-#include "talk/media/base/videocommon.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/base/videocapturer.h"
+#include "webrtc/media/base/videocommon.h"
 #include "webrtc/video_frame.h"
 
 using webrtc::kYPlane;
diff --git a/talk/media/webrtc/webrtcvideoframe.h b/webrtc/media/webrtc/webrtcvideoframe.h
similarity index 95%
rename from talk/media/webrtc/webrtcvideoframe.h
rename to webrtc/media/webrtc/webrtcvideoframe.h
index 33d2873..319f9c7 100644
--- a/talk/media/webrtc/webrtcvideoframe.h
+++ b/webrtc/media/webrtc/webrtcvideoframe.h
@@ -25,15 +25,15 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTCVIDEOFRAME_H_
-#define TALK_MEDIA_WEBRTCVIDEOFRAME_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOFRAME_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOFRAME_H_
 
-#include "talk/media/base/videoframe.h"
 #include "webrtc/base/buffer.h"
 #include "webrtc/base/refcount.h"
 #include "webrtc/base/scoped_ref_ptr.h"
 #include "webrtc/common_types.h"
 #include "webrtc/common_video/include/video_frame_buffer.h"
+#include "webrtc/media/base/videoframe.h"
 
 namespace cricket {
 
@@ -135,4 +135,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTCVIDEOFRAME_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOFRAME_H_
diff --git a/talk/media/webrtc/webrtcvideoframe_unittest.cc b/webrtc/media/webrtc/webrtcvideoframe_unittest.cc
similarity index 98%
rename from talk/media/webrtc/webrtcvideoframe_unittest.cc
rename to webrtc/media/webrtc/webrtcvideoframe_unittest.cc
index 2552331..ad2d7b7 100644
--- a/talk/media/webrtc/webrtcvideoframe_unittest.cc
+++ b/webrtc/media/webrtc/webrtcvideoframe_unittest.cc
@@ -27,8 +27,8 @@
 
 #include <string.h>
 
-#include "talk/media/base/videoframe_unittest.h"
-#include "talk/media/webrtc/webrtcvideoframe.h"
+#include "webrtc/media/base/videoframe_unittest.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
 #include "webrtc/test/fake_texture_frame.h"
 
 namespace {
diff --git a/talk/media/webrtc/webrtcvideoframefactory.cc b/webrtc/media/webrtc/webrtcvideoframefactory.cc
old mode 100755
new mode 100644
similarity index 94%
rename from talk/media/webrtc/webrtcvideoframefactory.cc
rename to webrtc/media/webrtc/webrtcvideoframefactory.cc
index b0c8d16..2af2b88
--- a/talk/media/webrtc/webrtcvideoframefactory.cc
+++ b/webrtc/media/webrtc/webrtcvideoframefactory.cc
@@ -25,9 +25,9 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "talk/media/webrtc/webrtcvideoframe.h"
-#include "talk/media/webrtc/webrtcvideoframefactory.h"
 #include "webrtc/base/logging.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
+#include "webrtc/media/webrtc/webrtcvideoframefactory.h"
 
 namespace cricket {
 
diff --git a/talk/media/webrtc/webrtcvideoframefactory.h b/webrtc/media/webrtc/webrtcvideoframefactory.h
similarity index 89%
rename from talk/media/webrtc/webrtcvideoframefactory.h
rename to webrtc/media/webrtc/webrtcvideoframefactory.h
index 5557a35..9981788 100644
--- a/talk/media/webrtc/webrtcvideoframefactory.h
+++ b/webrtc/media/webrtc/webrtcvideoframefactory.h
@@ -25,10 +25,10 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTC_WEBRTCVIDEOFRAMEFACTORY_H_
-#define TALK_MEDIA_WEBRTC_WEBRTCVIDEOFRAMEFACTORY_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOFRAMEFACTORY_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOFRAMEFACTORY_H_
 
-#include "talk/media/base/videoframefactory.h"
+#include "webrtc/media/base/videoframefactory.h"
 
 namespace cricket {
 
@@ -44,4 +44,4 @@
 
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTC_WEBRTCVIDEOFRAMEFACTORY_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOFRAMEFACTORY_H_
diff --git a/talk/media/webrtc/webrtcvideoframefactory_unittest.cc b/webrtc/media/webrtc/webrtcvideoframefactory_unittest.cc
similarity index 96%
rename from talk/media/webrtc/webrtcvideoframefactory_unittest.cc
rename to webrtc/media/webrtc/webrtcvideoframefactory_unittest.cc
index a9c1022..fa2221c 100644
--- a/talk/media/webrtc/webrtcvideoframefactory_unittest.cc
+++ b/webrtc/media/webrtc/webrtcvideoframefactory_unittest.cc
@@ -27,9 +27,9 @@
 
 #include <string.h>
 
-#include "talk/media/base/videoframe_unittest.h"
-#include "talk/media/webrtc/webrtcvideoframe.h"
-#include "talk/media/webrtc/webrtcvideoframefactory.h"
+#include "webrtc/media/base/videoframe_unittest.h"
+#include "webrtc/media/webrtc/webrtcvideoframe.h"
+#include "webrtc/media/webrtc/webrtcvideoframefactory.h"
 
 class WebRtcVideoFrameFactoryTest
     : public VideoFrameTest<cricket::WebRtcVideoFrameFactory> {
diff --git a/talk/media/webrtc/webrtcvoe.h b/webrtc/media/webrtc/webrtcvoe.h
similarity index 96%
rename from talk/media/webrtc/webrtcvoe.h
rename to webrtc/media/webrtc/webrtcvoe.h
index aa705a0..d55c359 100644
--- a/talk/media/webrtc/webrtcvoe.h
+++ b/webrtc/media/webrtc/webrtcvoe.h
@@ -25,11 +25,11 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTCVOE_H_
-#define TALK_MEDIA_WEBRTCVOE_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVOE_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVOE_H_
 
-#include "talk/media/webrtc/webrtccommon.h"
 #include "webrtc/base/common.h"
+#include "webrtc/media/webrtc/webrtccommon.h"
 
 #include "webrtc/common_types.h"
 #include "webrtc/modules/audio_device/include/audio_device.h"
@@ -133,4 +133,4 @@
 };
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTCVOE_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVOE_H_
diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/webrtc/media/webrtc/webrtcvoiceengine.cc
similarity index 99%
rename from talk/media/webrtc/webrtcvoiceengine.cc
rename to webrtc/media/webrtc/webrtcvoiceengine.cc
index 1500423..afdc678 100644
--- a/talk/media/webrtc/webrtcvoiceengine.cc
+++ b/webrtc/media/webrtc/webrtcvoiceengine.cc
@@ -31,19 +31,13 @@
 
 #ifdef HAVE_WEBRTC_VOICE
 
-#include "talk/media/webrtc/webrtcvoiceengine.h"
+#include "webrtc/media/webrtc/webrtcvoiceengine.h"
 
 #include <algorithm>
 #include <cstdio>
 #include <string>
 #include <vector>
 
-#include "talk/media/base/audioframe.h"
-#include "talk/media/base/audiorenderer.h"
-#include "talk/media/base/constants.h"
-#include "talk/media/base/streamparams.h"
-#include "talk/media/webrtc/webrtcmediaengine.h"
-#include "talk/media/webrtc/webrtcvoe.h"
 #include "webrtc/audio/audio_sink.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/base64.h"
@@ -55,6 +49,12 @@
 #include "webrtc/base/stringutils.h"
 #include "webrtc/call/rtc_event_log.h"
 #include "webrtc/common.h"
+#include "webrtc/media/base/audioframe.h"
+#include "webrtc/media/base/audiorenderer.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/streamparams.h"
+#include "webrtc/media/webrtc/webrtcmediaengine.h"
+#include "webrtc/media/webrtc/webrtcvoe.h"
 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h"
 #include "webrtc/modules/audio_processing/include/audio_processing.h"
 #include "webrtc/system_wrappers/include/field_trial.h"
diff --git a/talk/media/webrtc/webrtcvoiceengine.h b/webrtc/media/webrtc/webrtcvoiceengine.h
similarity index 97%
rename from talk/media/webrtc/webrtcvoiceengine.h
rename to webrtc/media/webrtc/webrtcvoiceengine.h
index 9f894c9..de12ef3 100644
--- a/talk/media/webrtc/webrtcvoiceengine.h
+++ b/webrtc/media/webrtc/webrtcvoiceengine.h
@@ -25,16 +25,13 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef TALK_MEDIA_WEBRTCVOICEENGINE_H_
-#define TALK_MEDIA_WEBRTCVOICEENGINE_H_
+#ifndef WEBRTC_MEDIA_WEBRTC_WEBRTCVOICEENGINE_H_
+#define WEBRTC_MEDIA_WEBRTC_WEBRTCVOICEENGINE_H_
 
 #include <map>
 #include <string>
 #include <vector>
 
-#include "talk/media/base/rtputils.h"
-#include "talk/media/webrtc/webrtccommon.h"
-#include "talk/media/webrtc/webrtcvoe.h"
 #include "talk/session/media/channel.h"
 #include "webrtc/audio_state.h"
 #include "webrtc/base/buffer.h"
@@ -44,6 +41,9 @@
 #include "webrtc/call.h"
 #include "webrtc/common.h"
 #include "webrtc/config.h"
+#include "webrtc/media/base/rtputils.h"
+#include "webrtc/media/webrtc/webrtccommon.h"
+#include "webrtc/media/webrtc/webrtcvoe.h"
 
 namespace cricket {
 
@@ -289,4 +289,4 @@
 };
 }  // namespace cricket
 
-#endif  // TALK_MEDIA_WEBRTCVOICEENGINE_H_
+#endif  // WEBRTC_MEDIA_WEBRTC_WEBRTCVOICEENGINE_H_
diff --git a/talk/media/webrtc/webrtcvoiceengine_unittest.cc b/webrtc/media/webrtc/webrtcvoiceengine_unittest.cc
similarity index 99%
rename from talk/media/webrtc/webrtcvoiceengine_unittest.cc
rename to webrtc/media/webrtc/webrtcvoiceengine_unittest.cc
index 73bb982..987567a 100644
--- a/talk/media/webrtc/webrtcvoiceengine_unittest.cc
+++ b/webrtc/media/webrtc/webrtcvoiceengine_unittest.cc
@@ -25,20 +25,20 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "talk/session/media/channel.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/byteorder.h"
 #include "webrtc/base/gunit.h"
 #include "webrtc/call.h"
 #include "webrtc/p2p/base/faketransportcontroller.h"
 #include "webrtc/test/field_trial.h"
-#include "talk/media/base/constants.h"
-#include "talk/media/base/fakemediaengine.h"
-#include "talk/media/base/fakenetworkinterface.h"
-#include "talk/media/base/fakertp.h"
-#include "talk/media/webrtc/fakewebrtccall.h"
-#include "talk/media/webrtc/fakewebrtcvoiceengine.h"
-#include "talk/media/webrtc/webrtcvoiceengine.h"
-#include "talk/session/media/channel.h"
+#include "webrtc/media/base/constants.h"
+#include "webrtc/media/base/fakemediaengine.h"
+#include "webrtc/media/base/fakenetworkinterface.h"
+#include "webrtc/media/base/fakertp.h"
+#include "webrtc/media/webrtc/fakewebrtccall.h"
+#include "webrtc/media/webrtc/fakewebrtcvoiceengine.h"
+#include "webrtc/media/webrtc/webrtcvoiceengine.h"
 
 using cricket::kRtpAudioLevelHeaderExtension;
 using cricket::kRtpAbsoluteSenderTimeHeaderExtension;
diff --git a/webrtc/webrtc.gyp b/webrtc/webrtc.gyp
index 15503cb..974ad92 100644
--- a/webrtc/webrtc.gyp
+++ b/webrtc/webrtc.gyp
@@ -11,6 +11,7 @@
       'includes': [
         'libjingle/xmllite/xmllite_tests.gypi',
         'libjingle/xmpp/xmpp_tests.gypi',
+        'media/media_tests.gypi',
         'p2p/p2p_tests.gypi',
         'sound/sound_tests.gypi',
         'webrtc_tests.gypi',
@@ -60,6 +61,7 @@
       'common.gyp:*',
       'common_audio/common_audio.gyp:*',
       'common_video/common_video.gyp:*',
+      'media/media.gyp:*',
       'modules/modules.gyp:*',
       'p2p/p2p.gyp:*',
       'system_wrappers/system_wrappers.gyp:*',
diff --git a/webrtc/webrtc_examples.gyp b/webrtc/webrtc_examples.gyp
index 44b2ca3..fd39b03 100755
--- a/webrtc/webrtc_examples.gyp
+++ b/webrtc/webrtc_examples.gyp
@@ -14,7 +14,7 @@
       'target_name': 'relayserver',
       'type': 'executable',
       'dependencies': [
-        '../talk/libjingle.gyp:libjingle',
+        '<(webrtc_root)/base/base.gyp:rtc_base',
         '../talk/libjingle.gyp:libjingle_p2p',
       ],
       'sources': [
@@ -25,7 +25,7 @@
       'target_name': 'stunserver',
       'type': 'executable',
       'dependencies': [
-        '../talk/libjingle.gyp:libjingle',
+        '<(webrtc_root)/base/base.gyp:rtc_base',
         '../talk/libjingle.gyp:libjingle_p2p',
       ],
       'sources': [
@@ -36,7 +36,7 @@
       'target_name': 'turnserver',
       'type': 'executable',
       'dependencies': [
-        '../talk/libjingle.gyp:libjingle',
+        '<(webrtc_root)/base/base.gyp:rtc_base',
         '../talk/libjingle.gyp:libjingle_p2p',
       ],
       'sources': [
@@ -56,8 +56,8 @@
         'examples/peerconnection/server/utils.h',
       ],
       'dependencies': [
+        '<(webrtc_root)/base/base.gyp:rtc_base',
         '<(webrtc_root)/common.gyp:webrtc_common',
-        '../talk/libjingle.gyp:libjingle',
       ],
       # TODO(ronghuawu): crbug.com/167187 fix size_t to int truncations.
       'msvs_disabled_warnings': [ 4309, ],
@@ -80,7 +80,6 @@
           'dependencies': [
             '../talk/libjingle.gyp:libjingle_peerconnection',
             '<(webrtc_root)/system_wrappers/system_wrappers.gyp:field_trial_default',
-            '<@(libjingle_tests_additional_deps)',
           ],
           'conditions': [
             ['build_json==1', {
diff --git a/webrtc/webrtc_tests.gypi b/webrtc/webrtc_tests.gypi
index c615d94..add7f6e 100644
--- a/webrtc/webrtc_tests.gypi
+++ b/webrtc/webrtc_tests.gypi
@@ -356,6 +356,19 @@
           ],
         },
         {
+          'target_name': 'libjingle_media_unittest_run',
+          'type': 'none',
+          'dependencies': [
+            'libjingle_media_unittest',
+          ],
+          'includes': [
+            'build/isolate.gypi',
+          ],
+          'sources': [
+            'libjingle_media_unittest.isolate',
+          ],
+        },
+        {
           'target_name': 'video_engine_tests_run',
           'type': 'none',
           'dependencies': [