diff mbox series

[FFmpeg-devel,v2,25/33] avdevice/dshow: move audio format helpers

Message ID 20210611203104.1692-26-dcnieho@gmail.com
State Superseded, archived
Headers show
Series avdevice (mostly dshow) enhancements | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Diederick C. Niehorster June 11, 2021, 8:30 p.m. UTC
Needs to be moved up in file for upcoming implementation of
avdevice_capabilities_create.

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
---
 libavdevice/dshow.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
diff mbox series

Patch

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 34c7b63220..4605bd6f8e 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -75,6 +75,26 @@  static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount)
     return avpriv_find_pix_fmt(avpriv_get_raw_pix_fmt_tags(), biCompression); // all others
 }
 
+static enum AVCodecID waveform_codec_id(enum AVSampleFormat sample_fmt)
+{
+    switch (sample_fmt) {
+    case AV_SAMPLE_FMT_U8:  return AV_CODEC_ID_PCM_U8;
+    case AV_SAMPLE_FMT_S16: return AV_CODEC_ID_PCM_S16LE;
+    case AV_SAMPLE_FMT_S32: return AV_CODEC_ID_PCM_S32LE;
+    default:                return AV_CODEC_ID_NONE; /* Should never happen. */
+    }
+}
+
+static enum AVSampleFormat sample_fmt_bits_per_sample(int bits)
+{
+    switch (bits) {
+    case 8:  return AV_SAMPLE_FMT_U8;
+    case 16: return AV_SAMPLE_FMT_S16;
+    case 32: return AV_SAMPLE_FMT_S32;
+    default: return AV_SAMPLE_FMT_NONE; /* Should never happen. */
+    }
+}
+
 static enum AVColorRange dshow_color_range(DXVA2_ExtendedFormat* fmt_info)
 {
     switch (fmt_info->NominalRange)
@@ -1629,26 +1649,6 @@  static int dshow_control_message(AVFormatContext *avctx, int type, void *data, s
     return ret;
 }
 
-static enum AVCodecID waveform_codec_id(enum AVSampleFormat sample_fmt)
-{
-    switch (sample_fmt) {
-    case AV_SAMPLE_FMT_U8:  return AV_CODEC_ID_PCM_U8;
-    case AV_SAMPLE_FMT_S16: return AV_CODEC_ID_PCM_S16LE;
-    case AV_SAMPLE_FMT_S32: return AV_CODEC_ID_PCM_S32LE;
-    default:                return AV_CODEC_ID_NONE; /* Should never happen. */
-    }
-}
-
-static enum AVSampleFormat sample_fmt_bits_per_sample(int bits)
-{
-    switch (bits) {
-    case 8:  return AV_SAMPLE_FMT_U8;
-    case 16: return AV_SAMPLE_FMT_S16;
-    case 32: return AV_SAMPLE_FMT_S32;
-    default: return AV_SAMPLE_FMT_NONE; /* Should never happen. */
-    }
-}
-
 static int
 dshow_add_device(AVFormatContext *avctx,
                  enum dshowDeviceType devtype)