iOS HW H264 support.

First step towards supporting H264 on iOS. More tuning/experimentation
required in future CLs. Tested using AppRTCDemo on iPhone6 + iPad Mini.
Future work to get it working on OS/X, simulator (renders black screen
currently) and with the Android AppRTCDemo. Currently protected with a
compile time guard.

BUG=4081
R=andrew@webrtc.org, haysc@webrtc.org, holmer@google.com, jiayl@webrtc.org, kjellander@webrtc.org, pbos@webrtc.org, phoglund@webrtc.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9515}
diff --git a/talk/examples/objc/AppRTCDemo/ARDAppClient.m b/talk/examples/objc/AppRTCDemo/ARDAppClient.m
index 0f3c423..ac99ca2 100644
--- a/talk/examples/objc/AppRTCDemo/ARDAppClient.m
+++ b/talk/examples/objc/AppRTCDemo/ARDAppClient.m
@@ -42,6 +42,7 @@
 #import "ARDCEODTURNClient.h"
 #import "ARDJoinResponse.h"
 #import "ARDMessageResponse.h"
+#import "ARDSDPUtils.h"
 #import "ARDSignalingMessage.h"
 #import "ARDUtilities.h"
 #import "ARDWebSocketChannel.h"
@@ -344,10 +345,15 @@
       [_delegate appClient:self didError:sdpError];
       return;
     }
+    // Prefer H264 if available.
+    RTCSessionDescription *sdpPreferringH264 =
+        [ARDSDPUtils descriptionForDescription:sdp
+                           preferredVideoCodec:@"H264"];
     [_peerConnection setLocalDescriptionWithDelegate:self
-                                  sessionDescription:sdp];
+                                  sessionDescription:sdpPreferringH264];
     ARDSessionDescriptionMessage *message =
-        [[ARDSessionDescriptionMessage alloc] initWithDescription:sdp];
+        [[ARDSessionDescriptionMessage alloc]
+            initWithDescription:sdpPreferringH264];
     [self sendSignalingMessage:message];
   });
 }
@@ -441,8 +447,12 @@
       ARDSessionDescriptionMessage *sdpMessage =
           (ARDSessionDescriptionMessage *)message;
       RTCSessionDescription *description = sdpMessage.sessionDescription;
+      // Prefer H264 if available.
+      RTCSessionDescription *sdpPreferringH264 =
+          [ARDSDPUtils descriptionForDescription:description
+                             preferredVideoCodec:@"H264"];
       [_peerConnection setRemoteDescriptionWithDelegate:self
-                                     sessionDescription:description];
+                                     sessionDescription:sdpPreferringH264];
       break;
     }
     case kARDSignalingMessageTypeCandidate: {