osxaudio: add mapping for top/left/right surround channels

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5731>
This commit is contained in:
Maksym Khomenko 2023-11-29 17:43:30 +02:00 committed by GStreamer Marge Bot
parent f1e02ebb92
commit ccf544a50e

View file

@ -421,6 +421,12 @@ gst_audio_channel_position_to_core_audio (GstAudioChannelPosition
return kAudioChannelLabel_VerticalHeightRight; return kAudioChannelLabel_VerticalHeightRight;
case GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER: case GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER:
return kAudioChannelLabel_VerticalHeightCenter; return kAudioChannelLabel_VerticalHeightCenter;
case GST_AUDIO_CHANNEL_POSITION_TOP_CENTER:
return kAudioChannelLabel_TopCenterSurround;
case GST_AUDIO_CHANNEL_POSITION_SURROUND_LEFT:
return kAudioChannelLabel_LeftSurround;
case GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT:
return kAudioChannelLabel_RightSurround;
/* Special position values */ /* Special position values */
case GST_AUDIO_CHANNEL_POSITION_NONE: case GST_AUDIO_CHANNEL_POSITION_NONE:
@ -430,14 +436,11 @@ gst_audio_channel_position_to_core_audio (GstAudioChannelPosition
/* Following positions are unmapped -- /* Following positions are unmapped --
* i.e. mapped to kAudioChannelLabel_Unknown: */ * i.e. mapped to kAudioChannelLabel_Unknown: */
case GST_AUDIO_CHANNEL_POSITION_TOP_CENTER:
case GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_LEFT: case GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_LEFT:
case GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_RIGHT: case GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_RIGHT:
case GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_CENTER: case GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_CENTER:
case GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_LEFT: case GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_LEFT:
case GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_RIGHT: case GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_RIGHT:
case GST_AUDIO_CHANNEL_POSITION_SURROUND_LEFT:
case GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT:
default: default:
return kAudioChannelLabel_Unknown; return kAudioChannelLabel_Unknown;
} }
@ -489,6 +492,12 @@ gst_core_audio_channel_label_to_gst (AudioChannelLabel label,
return GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT; return GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT;
case kAudioChannelLabel_VerticalHeightCenter: case kAudioChannelLabel_VerticalHeightCenter:
return GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER; return GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER;
case kAudioChannelLabel_RearSurroundLeft:
return GST_AUDIO_CHANNEL_POSITION_REAR_LEFT;
case kAudioChannelLabel_RearSurroundRight:
return GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT;
case kAudioChannelLabel_TopCenterSurround:
return GST_AUDIO_CHANNEL_POSITION_TOP_CENTER;
/* Special position values */ /* Special position values */
@ -502,9 +511,6 @@ gst_core_audio_channel_label_to_gst (AudioChannelLabel label,
Following labels are unmapped -- Following labels are unmapped --
i.e. mapped to GST_AUDIO_CHANNEL_POSITION_INVALID: i.e. mapped to GST_AUDIO_CHANNEL_POSITION_INVALID:
*/ */
case kAudioChannelLabel_RearSurroundLeft:
case kAudioChannelLabel_RearSurroundRight:
case kAudioChannelLabel_TopCenterSurround:
case kAudioChannelLabel_LeftTotal: case kAudioChannelLabel_LeftTotal:
case kAudioChannelLabel_RightTotal: case kAudioChannelLabel_RightTotal:
case kAudioChannelLabel_HearingImpaired: case kAudioChannelLabel_HearingImpaired: