~audio-recorder/audio-recorder/trunk

« back to all changes in this revision

Viewing changes to src/media-profiles.c

  • Committer: Osmo Antero
  • Date: 2021-11-04 08:22:20 UTC
  • Revision ID: osmoma@gmail.com-20211104082220-nyunkxi37fq4600v
Version 3.3.4. Removed Speexenc (SPX) encoder from MediaProfiles. Added opus encoder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "utility.h"
22
22
#include "support.h"
23
23
 
24
 
// Automatic plugin installation has not been implemented yet.
 
24
#if 0 
 
25
    // For xid
 
26
    #include <gtk/gtk.h>
 
27
    #ifdef GDK_WINDOWING_X11
 
28
    #include <gdk/gdkx.h>
 
29
    #endif
 
30
#endif
 
31
 
25
32
#include <gst/pbutils/missing-plugins.h>
26
33
#include <gst/pbutils/install-plugins.h>
27
34
 
36
43
// $ audio-recorder --reset
37
44
//
38
45
ProfileRec DefaultProfiles[] = {
39
 
    {"M4A AAC Lossy 44KHz",  "m4a",  "", "audio/x-raw,rate=44100,channels=2 ! avenc_aac ! mp4mux"},
40
46
    {"FLAC Lossless 44KHz",  "flac", "", "audio/x-raw,rate=44100,channels=2 ! flacenc name=enc"},
41
47
    {"OGG Lossy 44KHz",      "ogg",  "", "audio/x-raw,rate=44100,channels=2 ! vorbisenc name=enc quality=0.5 ! oggmux"},
42
48
    {"MP3 Lossy 44KHz",      "mp3",  "", "audio/x-raw,rate=44100,channels=2 ! lamemp3enc name=enc target=0 quality=2"},
43
49
    {"WAV Lossless 22KHz",   "wav",  "", "audio/x-raw,rate=22050,channels=1 ! wavenc name=enc"},
44
50
    {"WAV Lossless 44KHz",   "wav",  "", "audio/x-raw,rate=44100,channels=2 ! wavenc name=enc"},
45
51
    {"OPUS Mono Lossy 16KHz","opus", "", "audio/x-raw,rate=16000,channels=1 ! opusenc name=enc ! oggmux"},
46
 
    {"OPUS lossy 32KHz",     "opus", "", "audio/x-raw,rate=32000,channels=2 ! opusenc name=enc ! oggmux"}
 
52
    {"OPUS lossy 48KHz",     "opus", "", "audio/x-raw,rate=48000,channels=2 ! opusenc name=enc ! oggmux"},
 
53
    {"M4A AAC Lossy 44KHz",  "m4a",  "", "audio/x-raw,rate=44100,channels=2 ! avenc_aac ! mp4mux"}
47
54
 };
48
55
 
49
56
// EDIT: 03.nov.2021:
50
 
// Speexenc is now obsolete. Ref https://www.speex.org/ 
 
57
// Speexenc (SPX) is now obsolete. Ref https://www.speex.org/ 
51
58
// Use Opus encoder instead. Ref. https://opus-codec.org/
52
59
// Removed SPX from DefaultPofiles[].
53
60
// {"SPX speex 32KHz", "spx",  "", "audio/x-raw,rate=32000,channels=2 ! speexenc name=enc ! oggmux"},
668
675
 
669
676
        report_plugin_return_code(ret);
670
677
 
 
678
        /*
 
679
          The M4A AAC (MPEG-2 and MPEG-4) audio format is provided for  
 
680
          RPM systems: by gstreamer1-libav package, on RPM distros like Fedora, RedHat, etc. The package repository is https://rpmfusion.org/
 
681
           
 
682
          DEB system: by gstreamer1.0-libav package, on DEB distros like Debian, Ubuntu, etc.
 
683
        */
 
684
        
 
685
        if (g_strrstr0(str, "avenc_aac")) {
 
686
 
 
687
            *err_msg = g_strdup_printf("M4A AAC format (and %s plugin) is provided by gstreamer1.0-libav package on (.deb) Debian/Ubuntu type systems.  \
 
688
It is provided by gstreamer1-libav package on (.rpm) RedHat/Fedora type systems. (in the https://rpmfusion.org/ package archive).", str);    
 
689
 
 
690
        } else  {
 
691
 
 
692
            //*err_msg = g_strdup_printf(_("Please install additional plugins (from gstreamer1.0-plugins-* package) to support the %s format.\n"), rec->ext);
 
693
            *err_msg = g_strdup_printf("To support %s format you should install Gstreamer-plugins for %s.\n", rec->ext, str);
 
694
        }
 
695
 
671
696
        if (ret == GST_INSTALL_PLUGINS_STARTED_OK) {
672
697
 
673
 
            *err_msg = g_strdup_printf(_("Please install additional plugins (from gstreamer1.0-plugins-* package) to support the %s format.\n"), rec->ext);
674
698
            // details[] is freed by the callback function.
675
699
 
676
700
        } else if (ret == GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS) {
677
701
 
678
 
            *err_msg = g_strdup_printf(_("Please install additional plugins (from gstreamer1.0-plugins-* package) to support the %s format.\n"), rec->ext);
679
702
            g_strfreev(details);
680
703
 
681
704
        } else if (ret == GST_INSTALL_PLUGINS_ERROR) {
682
705
 
683
 
            *err_msg = g_strdup_printf(_("Please install additional plugins (from gstreamer1.0-plugins-* package) to support the %s format.\n"), rec->ext);
684
706
            g_strfreev(details);
685
707
        }
686
 
 
 
708
    }
 
709
 
 
710
 
 
711
    if (*err_msg)  {
 
712
        LOG_ERROR(*err_msg);
687
713
    }
688
714
 
689
715
    g_free(str);