29
29
#include " api/rtp_transceiver_direction.h"
30
30
#include " api/sctp_transport_interface.h"
31
31
#include " media/base/codec.h"
32
- #include " media/base/codec_list.h"
33
32
#include " media/base/media_constants.h"
34
33
#include " media/base/media_engine.h"
35
34
#include " media/base/rid_description.h"
@@ -734,16 +733,6 @@ MediaSessionDescriptionFactory::CreateOfferOrError(
734
733
cricket::StreamParamsVec current_streams =
735
734
GetCurrentStreamParams (current_active_contents);
736
735
737
- cricket::CodecList offer_audio_codecs;
738
- cricket::CodecList offer_video_codecs;
739
-
740
- // TODO: issues.webrtc.org/360058654 - Get codecs when we know the right mid.
741
- RTCError error = codec_lookup_helper_->CodecVendor (" " )->GetCodecsForOffer (
742
- current_active_contents, offer_audio_codecs, offer_video_codecs);
743
- if (!error.ok ()) {
744
- return error;
745
- }
746
-
747
736
AudioVideoRtpHeaderExtensions extensions_with_ids =
748
737
GetOfferedRtpHeaderExtensionsWithIds (
749
738
current_active_contents, session_options.offer_extmap_allow_mixed ,
@@ -762,6 +751,7 @@ MediaSessionDescriptionFactory::CreateOfferOrError(
762
751
current_content = ¤t_description->contents ()[msection_index];
763
752
// Media type must match unless this media section is being recycled.
764
753
}
754
+ RTCError error;
765
755
switch (media_description_options.type ) {
766
756
case webrtc::MediaType::AUDIO:
767
757
case webrtc::MediaType::VIDEO:
@@ -771,9 +761,6 @@ MediaSessionDescriptionFactory::CreateOfferOrError(
771
761
media_description_options.type == webrtc::MediaType::AUDIO
772
762
? extensions_with_ids.audio
773
763
: extensions_with_ids.video ,
774
- media_description_options.type == webrtc::MediaType::AUDIO
775
- ? offer_audio_codecs
776
- : offer_video_codecs,
777
764
¤t_streams, offer.get (), &ice_credentials);
778
765
break ;
779
766
case webrtc::MediaType::DATA:
@@ -882,22 +869,6 @@ MediaSessionDescriptionFactory::CreateAnswerOrError(
882
869
}
883
870
}
884
871
885
- // Get list of all possible codecs that respects existing payload type
886
- // mappings and uses a single payload type space.
887
- //
888
- // Note that these lists may be further filtered for each m= section; this
889
- // step is done just to establish the payload type mappings shared by all
890
- // sections.
891
- cricket::CodecList answer_audio_codecs;
892
- cricket::CodecList answer_video_codecs;
893
- // TODO: issues.webrtc.org/360058654 - do this when we have the MID.
894
- RTCError error = codec_lookup_helper_->CodecVendor (" " )->GetCodecsForAnswer (
895
- current_active_contents, *offer, answer_audio_codecs,
896
- answer_video_codecs);
897
- if (!error.ok ()) {
898
- return error;
899
- }
900
-
901
872
auto answer = std::make_unique<SessionDescription>();
902
873
903
874
// If the offer supports BUNDLE, and we want to use it too, create a BUNDLE
@@ -958,15 +929,13 @@ MediaSessionDescriptionFactory::CreateAnswerOrError(
958
929
cricket::RtpHeaderExtensions header_extensions =
959
930
RtpHeaderExtensionsFromCapabilities (
960
931
UnstoppedRtpHeaderExtensionCapabilities (header_extensions_in));
932
+ RTCError error;
961
933
switch (media_description_options.type ) {
962
934
case webrtc::MediaType::AUDIO:
963
935
case webrtc::MediaType::VIDEO:
964
936
error = AddRtpContentForAnswer (
965
937
media_description_options, session_options, offer_content, offer,
966
938
current_content, current_description, bundle_transport,
967
- media_description_options.type == webrtc::MediaType::AUDIO
968
- ? answer_audio_codecs
969
- : answer_video_codecs,
970
939
header_extensions, ¤t_streams, answer.get (),
971
940
&ice_credentials);
972
941
break ;
@@ -1195,7 +1164,6 @@ RTCError MediaSessionDescriptionFactory::AddRtpContentForOffer(
1195
1164
const ContentInfo* current_content,
1196
1165
const SessionDescription* current_description,
1197
1166
const cricket::RtpHeaderExtensions& header_extensions,
1198
- const cricket::CodecList& codecs,
1199
1167
cricket::StreamParamsVec* current_streams,
1200
1168
SessionDescription* session_description,
1201
1169
cricket::IceCredentialsIterator* ice_credentials) const {
@@ -1207,7 +1175,7 @@ RTCError MediaSessionDescriptionFactory::AddRtpContentForOffer(
1207
1175
RTCErrorOr<std::vector<cricket::Codec>> error_or_filtered_codecs =
1208
1176
codec_lookup_helper_->CodecVendor (mid)->GetNegotiatedCodecsForOffer (
1209
1177
media_description_options, session_options, current_content,
1210
- *codec_lookup_helper_->PayloadTypeSuggester (), codecs );
1178
+ *codec_lookup_helper_->PayloadTypeSuggester ());
1211
1179
if (!error_or_filtered_codecs.ok ()) {
1212
1180
return error_or_filtered_codecs.MoveError ();
1213
1181
}
@@ -1327,7 +1295,6 @@ RTCError MediaSessionDescriptionFactory::AddRtpContentForAnswer(
1327
1295
const ContentInfo* current_content,
1328
1296
const SessionDescription* current_description,
1329
1297
const cricket::TransportInfo* bundle_transport,
1330
- const cricket::CodecList& codecs,
1331
1298
const cricket::RtpHeaderExtensions& header_extensions,
1332
1299
cricket::StreamParamsVec* current_streams,
1333
1300
SessionDescription* answer,
@@ -1371,7 +1338,7 @@ RTCError MediaSessionDescriptionFactory::AddRtpContentForAnswer(
1371
1338
->GetNegotiatedCodecsForAnswer (
1372
1339
media_description_options, session_options, offer_rtd, answer_rtd,
1373
1340
current_content, offer_content_description->codecs (),
1374
- *codec_lookup_helper_->PayloadTypeSuggester (), codecs );
1341
+ *codec_lookup_helper_->PayloadTypeSuggester ());
1375
1342
if (!error_or_filtered_codecs.ok ()) {
1376
1343
return error_or_filtered_codecs.MoveError ();
1377
1344
}
0 commit comments