Remove schroedinger plugin

No upstream (website disappeared), no maintainer, and
pretty much a fringe format anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=776215
This commit is contained in:
Tim-Philipp Müller 2018-03-01 15:24:39 +00:00
parent 39d408f3d6
commit a0cc9d1af0
21 changed files with 3 additions and 2808 deletions

View file

@ -62,6 +62,7 @@ CRUFT_FILES = \
$(top_builddir)/gst/opus/.libs/libgstopus.{so,dll,DLL,dylib} \
$(top_builddir)/ext/mpg123/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/ext/qt/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/ext/schroedinger/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/gst/aacparse/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/gst/amrparse/.libs/*.{so,dll,DLL,dylib} \
$(top_builddir)/gst/audiomixer/.libs/*.{so,dll,DLL,dylib} \
@ -92,6 +93,7 @@ CRUFT_FILES = \
$(top_builddir)/tests/check/elements/rawaudioparse \
$(top_builddir)/tests/check/elements/rawvideoparse \
$(top_builddir)/tests/check/elements/rtpmux \
$(top_builddir)/tests/check/elements/schroenc \
$(top_builddir)/tests/check/elements/selector \
$(top_builddir)/tests/check/elements/valve \
$(top_builddir)/tests/check/pipelines/metadata \
@ -148,6 +150,7 @@ CRUFT_DIRS = \
$(top_srcdir)/ext/mimic \
$(top_srcdir)/ext/mpg123 \
$(top_srcdir)/ext/qt \
$(top_srcdir)/ext/schroedinger \
$(top_srcdir)/ext/swfdec \
$(top_srcdir)/ext/tarkin \
$(top_srcdir)/ext/theora \

View file

@ -2178,12 +2178,6 @@ AG_GST_CHECK_FEATURE(SBC, [SBC bluetooth audio codec], sbc, [
AG_GST_PKG_CHECK_MODULES(SBC, [sbc >= 1.0])
])
dnl *** schroedinger ***
translit(dnm, m, l) AM_CONDITIONAL(USE_SCHRO, true)
AG_GST_CHECK_FEATURE(SCHRO, [Schroedinger video codec], schro, [
AG_GST_PKG_CHECK_MODULES(SCHRO, schroedinger-1.0 >= 1.0.10)
])
dnl *** zbar ***
translit(dnm, m, l) AM_CONDITIONAL(USE_ZBAR, true)
AG_GST_CHECK_FEATURE(ZBAR, [ZBar barcode detector], zbar, [
@ -2376,7 +2370,6 @@ AM_CONDITIONAL(USE_DVB, false)
AM_CONDITIONAL(USE_ACM, false)
AM_CONDITIONAL(USE_VDPAU, false)
AM_CONDITIONAL(USE_SBC, false)
AM_CONDITIONAL(USE_SCHRO, false)
AM_CONDITIONAL(USE_ZBAR, false)
AM_CONDITIONAL(USE_RSVG, false)
AM_CONDITIONAL(USE_RTMP, false)
@ -2663,7 +2656,6 @@ ext/rsvg/Makefile
ext/resindvd/Makefile
ext/rtmp/Makefile
ext/sbc/Makefile
ext/schroedinger/Makefile
ext/smoothstreaming/Makefile
ext/sndfile/Makefile
ext/soundtouch/Makefile

View file

@ -3168,38 +3168,6 @@ GST_TYPE_SCENE_CHANGE
gst_scene_change_get_type
</SECTION>
<SECTION>
<FILE>element-schrodec</FILE>
<TITLE>schrodec</TITLE>
GstSchroDec
<SUBSECTION Standard>
GstSchroDecClass
GST_SCHRO_DEC
GST_SCHRO_DEC_CAST
GST_IS_SCHRO_DEC
GST_SCHRO_DEC_CLASS
GST_IS_SCHRO_DEC_CLASS
GST_TYPE_SCHRO_DEC
<SUBSECTION Private>
gst_schro_dec_get_type
</SECTION>
<SECTION>
<FILE>element-schroenc</FILE>
<TITLE>schroenc</TITLE>
GstSchroEnc
<SUBSECTION Standard>
GstSchroEncClass
GST_SCHRO_ENC
GST_SCHRO_ENC_CAST
GST_IS_SCHRO_ENC
GST_SCHRO_ENC_CLASS
GST_IS_SCHRO_ENC_CLASS
GST_TYPE_SCHRO_ENC
<SUBSECTION Private>
gst_schro_enc_get_type
</SECTION>
<SECTION>
<FILE>element-sdpsrc</FILE>
<TITLE>sdpsrc</TITLE>

View file

@ -28508,756 +28508,6 @@
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::au-distance</NAME>
<TYPE>gint</TYPE>
<RANGE>>= 1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>au_distance</NICK>
<BLURB>au_distance.</BLURB>
<DEFAULT>120</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::bitrate</NAME>
<TYPE>gint</TYPE>
<RANGE>>= 0</RANGE>
<FLAGS>rw</FLAGS>
<NICK>bitrate</NICK>
<BLURB>bitrate.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::buffer-level</NAME>
<TYPE>gint</TYPE>
<RANGE>>= 0</RANGE>
<FLAGS>rw</FLAGS>
<NICK>buffer_level</NICK>
<BLURB>buffer_level.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::buffer-size</NAME>
<TYPE>gint</TYPE>
<RANGE>>= 0</RANGE>
<FLAGS>rw</FLAGS>
<NICK>buffer_size</NICK>
<BLURB>buffer_size.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-bigblock-estimation</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_bigblock_estimation</NICK>
<BLURB>enable_bigblock_estimation.</BLURB>
<DEFAULT>TRUE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-dc-multiquant</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_dc_multiquant</NICK>
<BLURB>enable_dc_multiquant.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-fullscan-estimation</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_fullscan_estimation</NICK>
<BLURB>enable_fullscan_estimation.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-global-motion</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_global_motion</NICK>
<BLURB>enable_global_motion.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-hierarchical-estimation</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_hierarchical_estimation</NICK>
<BLURB>enable_hierarchical_estimation.</BLURB>
<DEFAULT>TRUE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-internal-testing</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_internal_testing</NICK>
<BLURB>enable_internal_testing.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-md5</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_md5</NICK>
<BLURB>enable_md5.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-multiquant</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_multiquant</NICK>
<BLURB>enable_multiquant.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-noarith</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_noarith</NICK>
<BLURB>enable_noarith.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-phasecorr-estimation</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_phasecorr_estimation</NICK>
<BLURB>enable_phasecorr_estimation.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-psnr</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_psnr</NICK>
<BLURB>enable_psnr.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-ssim</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_ssim</NICK>
<BLURB>enable_ssim.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-zero-estimation</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_zero_estimation</NICK>
<BLURB>enable_zero_estimation.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::filter-value</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,100]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>filter_value</NICK>
<BLURB>filter_value.</BLURB>
<DEFAULT>5</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::filtering</NAME>
<TYPE>SchroEncoderSettingEnum_filtering</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>filtering</NICK>
<BLURB>filtering.</BLURB>
<DEFAULT>none</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::gop-structure</NAME>
<TYPE>SchroEncoderSettingEnum_gop_structure</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>gop_structure</NICK>
<BLURB>gop_structure.</BLURB>
<DEFAULT>adaptive</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::horiz-slices</NAME>
<TYPE>gint</TYPE>
<RANGE>>= 0</RANGE>
<FLAGS>rw</FLAGS>
<NICK>horiz_slices</NICK>
<BLURB>horiz_slices.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::inter-wavelet</NAME>
<TYPE>SchroEncoderSettingEnum_inter_wavelet</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>inter_wavelet</NICK>
<BLURB>inter_wavelet.</BLURB>
<DEFAULT>desl-dubuc-9-7</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::interlaced-coding</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>interlaced_coding</NICK>
<BLURB>interlaced_coding.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::intra-wavelet</NAME>
<TYPE>SchroEncoderSettingEnum_intra_wavelet</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>intra_wavelet</NICK>
<BLURB>intra_wavelet.</BLURB>
<DEFAULT>desl-dubuc-9-7</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::level</NAME>
<TYPE>gint</TYPE>
<RANGE>[0,0]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>level</NICK>
<BLURB>level.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-allocation-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_allocation_scale</NICK>
<BLURB>magic_allocation_scale.</BLURB>
<DEFAULT>1.1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-badblock-multiplier-nonref</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_badblock_multiplier_nonref</NICK>
<BLURB>magic_badblock_multiplier_nonref.</BLURB>
<DEFAULT>4</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-badblock-multiplier-ref</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_badblock_multiplier_ref</NICK>
<BLURB>magic_badblock_multiplier_ref.</BLURB>
<DEFAULT>8</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-bailout-weight</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_bailout_weight</NICK>
<BLURB>magic_bailout_weight.</BLURB>
<DEFAULT>4</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-block-search-threshold</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_block_search_threshold</NICK>
<BLURB>magic_block_search_threshold.</BLURB>
<DEFAULT>15</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-chroma-lambda-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_chroma_lambda_scale</NICK>
<BLURB>magic_chroma_lambda_scale.</BLURB>
<DEFAULT>0.1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-dc-metric-offset</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_dc_metric_offset</NICK>
<BLURB>magic_dc_metric_offset.</BLURB>
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-error-power</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_error_power</NICK>
<BLURB>magic_error_power.</BLURB>
<DEFAULT>4</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-inter-b-weight</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_inter_b_weight</NICK>
<BLURB>magic_inter_b_weight.</BLURB>
<DEFAULT>0.2</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-inter-p-weight</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_inter_p_weight</NICK>
<BLURB>magic_inter_p_weight.</BLURB>
<DEFAULT>1.5</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-keyframe-weight</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_keyframe_weight</NICK>
<BLURB>magic_keyframe_weight.</BLURB>
<DEFAULT>7.5</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-lambda</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_lambda</NICK>
<BLURB>magic_lambda.</BLURB>
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-mc-bailout-limit</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_mc_bailout_limit</NICK>
<BLURB>magic_mc_bailout_limit.</BLURB>
<DEFAULT>0.5</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-mc-lambda</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_mc_lambda</NICK>
<BLURB>magic_mc_lambda.</BLURB>
<DEFAULT>0.1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-nonref-lambda-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_nonref_lambda_scale</NICK>
<BLURB>magic_nonref_lambda_scale.</BLURB>
<DEFAULT>0.01</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-scene-change-threshold</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_scene_change_threshold</NICK>
<BLURB>magic_scene_change_threshold.</BLURB>
<DEFAULT>3</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-subband0-lambda-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_subband0_lambda_scale</NICK>
<BLURB>magic_subband0_lambda_scale.</BLURB>
<DEFAULT>10</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-subgroup-length</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[1,10]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_subgroup_length</NICK>
<BLURB>magic_subgroup_length.</BLURB>
<DEFAULT>4</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::max-bitrate</NAME>
<TYPE>gint</TYPE>
<RANGE>>= 0</RANGE>
<FLAGS>rw</FLAGS>
<NICK>max_bitrate</NICK>
<BLURB>max_bitrate.</BLURB>
<DEFAULT>13824000</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::min-bitrate</NAME>
<TYPE>gint</TYPE>
<RANGE>>= 0</RANGE>
<FLAGS>rw</FLAGS>
<NICK>min_bitrate</NICK>
<BLURB>min_bitrate.</BLURB>
<DEFAULT>13824000</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::motion-block-overlap</NAME>
<TYPE>SchroEncoderSettingEnum_motion_block_overlap</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>motion_block_overlap</NICK>
<BLURB>motion_block_overlap.</BLURB>
<DEFAULT>automatic</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::motion-block-size</NAME>
<TYPE>SchroEncoderSettingEnum_motion_block_size</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>motion_block_size</NICK>
<BLURB>motion_block_size.</BLURB>
<DEFAULT>automatic</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::mv-precision</NAME>
<TYPE>gint</TYPE>
<RANGE>[0,3]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>mv_precision</NICK>
<BLURB>mv_precision.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::noise-threshold</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,100]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>noise_threshold</NICK>
<BLURB>noise_threshold.</BLURB>
<DEFAULT>25</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::open-gop</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>open_gop</NICK>
<BLURB>open_gop.</BLURB>
<DEFAULT>TRUE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::perceptual-distance</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,100]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>perceptual_distance</NICK>
<BLURB>perceptual_distance.</BLURB>
<DEFAULT>4</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::perceptual-weighting</NAME>
<TYPE>SchroEncoderSettingEnum_perceptual_weighting</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>perceptual_weighting</NICK>
<BLURB>perceptual_weighting.</BLURB>
<DEFAULT>ccir959</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::profile</NAME>
<TYPE>gint</TYPE>
<RANGE>[0,0]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>profile</NICK>
<BLURB>profile.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::quality</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,10]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>quality</NICK>
<BLURB>quality.</BLURB>
<DEFAULT>5</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::queue-depth</NAME>
<TYPE>gint</TYPE>
<RANGE>[1,40]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>queue_depth</NICK>
<BLURB>queue_depth.</BLURB>
<DEFAULT>20</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::rate-control</NAME>
<TYPE>SchroEncoderSettingEnum_rate_control</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>rate_control</NICK>
<BLURB>rate_control.</BLURB>
<DEFAULT>constant-quality</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::ref-distance</NAME>
<TYPE>gint</TYPE>
<RANGE>[2,20]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>ref_distance</NICK>
<BLURB>ref_distance.</BLURB>
<DEFAULT>4</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::transform-depth</NAME>
<TYPE>gint</TYPE>
<RANGE>[0,6]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>transform_depth</NICK>
<BLURB>transform_depth.</BLURB>
<DEFAULT>3</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::vert-slices</NAME>
<TYPE>gint</TYPE>
<RANGE>>= 0</RANGE>
<FLAGS>rw</FLAGS>
<NICK>vert_slices</NICK>
<BLURB>vert_slices.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::codeblock-size</NAME>
<TYPE>SchroEncoderSettingEnum_codeblock_size</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>codeblock_size</NICK>
<BLURB>codeblock_size.</BLURB>
<DEFAULT>automatic</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-scan-distance</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_scan_distance</NICK>
<BLURB>magic_scan_distance.</BLURB>
<DEFAULT>4</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::downsample-levels</NAME>
<TYPE>gint</TYPE>
<RANGE>[2,8]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>downsample_levels</NICK>
<BLURB>downsample_levels.</BLURB>
<DEFAULT>5</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-chroma-me</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_chroma_me</NICK>
<BLURB>enable_chroma_me.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-deep-estimation</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_deep_estimation</NICK>
<BLURB>enable_deep_estimation.</BLURB>
<DEFAULT>TRUE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-rdo-cbr</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_rdo_cbr</NICK>
<BLURB>enable_rdo_cbr.</BLURB>
<DEFAULT>TRUE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::enable-scene-change-detection</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>enable_scene_change_detection</NICK>
<BLURB>enable_scene_change_detection.</BLURB>
<DEFAULT>TRUE</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::force-profile</NAME>
<TYPE>SchroEncoderSettingEnum_force_profile</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>force_profile</NICK>
<BLURB>force_profile.</BLURB>
<DEFAULT>auto</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-B-lambda-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,10]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_B_lambda_scale</NICK>
<BLURB>magic_B_lambda_scale.</BLURB>
<DEFAULT>0.01</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-I-lambda-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,100]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_I_lambda_scale</NICK>
<BLURB>magic_I_lambda_scale.</BLURB>
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-P-lambda-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,10]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_P_lambda_scale</NICK>
<BLURB>magic_P_lambda_scale.</BLURB>
<DEFAULT>0.25</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-diagonal-lambda-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_diagonal_lambda_scale</NICK>
<BLURB>magic_diagonal_lambda_scale.</BLURB>
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-inter-cpd-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_inter_cpd_scale</NICK>
<BLURB>magic_inter_cpd_scale.</BLURB>
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-me-bailout-limit</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1000]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_me_bailout_limit</NICK>
<BLURB>magic_me_bailout_limit.</BLURB>
<DEFAULT>0.33</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::magic-me-lambda-scale</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,100]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>magic_me_lambda_scale</NICK>
<BLURB>magic_me_lambda_scale.</BLURB>
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstSchroEnc::max-refs</NAME>
<TYPE>gint</TYPE>
<RANGE>[1,4]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>max_refs</NICK>
<BLURB>max_refs.</BLURB>
<DEFAULT>3</DEFAULT>
</ARG>
<ARG>
<NAME>GstAmrWbEnc::band-mode</NAME>
<TYPE>GstAmrWbEncBandMode</TYPE>
@ -29268,16 +28518,6 @@
<DEFAULT>MR660</DEFAULT>
</ARG>
<ARG>
<NAME>GstMimEnc::paused-mode</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>Paused mode</NICK>
<BLURB>If enabled, empty frames will be generated every 4 seconds when no data is received.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstPnmenc::ascii</NAME>
<TYPE>gboolean</TYPE>

View file

@ -305,7 +305,6 @@ GObject
GstOpenh264Dec
GstPnmdec
GstRsvgDec
GstSchroDec
GstVMncDec
GstVdpDecoder
GstVdpMpegDec
@ -314,7 +313,6 @@ GObject
GstOpenJPEGEnc
GstOpenh264Enc
GstPnmenc
GstSchroEnc
GstWebpEnc
GstX265Enc
GstVideoFrameAudioLevel

View file

@ -85,7 +85,6 @@ GstRTMPSrc GstURIHandler
GstSDLVideoSink GstImplementsInterface GstXOverlay GstNavigation
GstSDPDemux GstChildProxy
GstSbcEnc GstPreset
GstSchroEnc GstPreset
GstSdpSrc GstChildProxy GstURIHandler
GstSirenEnc GstPreset
GstTagMux GstTagSetter

View file

@ -1,55 +0,0 @@
<plugin>
<name>schro</name>
<description>Schroedinger plugin</description>
<filename>../../ext/schroedinger/.libs/libgstschro.so</filename>
<basename>libgstschro.so</basename>
<version>1.13.1.1</version>
<license>LGPL</license>
<source>gst-plugins-bad</source>
<package>GStreamer Bad Plug-ins git</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>schrodec</name>
<longname>Dirac Decoder</longname>
<class>Codec/Decoder/Video</class>
<description>Decode Dirac streams</description>
<author>David Schleef &lt;ds@schleef.org&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>video/x-dirac</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, Y42B, Y444, v216, v210, AY64 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
</caps>
</pads>
</element>
<element>
<name>schroenc</name>
<longname>Dirac Encoder</longname>
<class>Codec/Encoder/Video</class>
<description>Encode raw video into Dirac stream</description>
<author>David Schleef &lt;ds@schleef.org&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>video/x-raw, format=(string){ I420, YV12, YUY2, UYVY, AYUV, Y42B, Y444, v216, v210, AY64 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>video/x-dirac; video/x-qt-part; video/x-mp4-part</details>
</caps>
</pads>
</element>
</elements>
</plugin>

View file

@ -280,12 +280,6 @@ else
SBC_DIR=
endif
if USE_SCHRO
SCHRO_DIR=schroedinger
else
SCHRO_DIR=
endif
if USE_SMOOTHSTREAMING
SMOOTHSTREAMING_DIR = smoothstreaming
else
@ -454,7 +448,6 @@ SUBDIRS=\
$(OPUS_DIR) \
$(RSVG_DIR) \
$(SBC_DIR) \
$(SCHRO_DIR) \
$(SMOOTHSTREAMING_DIR) \
$(SMOOTHWAVE_DIR) \
$(SNDFILE_DIR) \
@ -522,7 +515,6 @@ DIST_SUBDIRS = \
rsvg \
resindvd \
sbc \
schroedinger \
smoothstreaming \
sndfile \
soundtouch \

View file

@ -42,7 +42,6 @@ subdir('resindvd')
subdir('rsvg')
subdir('rtmp')
subdir('sbc')
subdir('schroedinger')
subdir('smoothstreaming')
#subdir('sndfile')
if cc.get_id() != 'msvc'

View file

@ -1,24 +0,0 @@
plugin_LTLIBRARIES = libgstschro.la
noinst_HEADERS = \
gstschroutils.h
libgstschro_la_SOURCES = \
gstschro.c \
gstschrodec.c \
gstschroenc.c \
gstschroutils.c
libgstschro_la_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
-DGST_USE_UNSTABLE_API \
$(SCHRO_CFLAGS)
libgstschro_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) -lgstvideo-@GST_API_VERSION@ \
$(GST_BASE_LIBS) $(GST_LIBS) \
$(SCHRO_LIBS)
libgstschro_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)

View file

@ -1,51 +0,0 @@
/* GStreamer
* Copyright (C) 2005 David Schleef <ds@schleef.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <schroedinger/schro.h>
GType gst_schro_enc_get_type (void);
GType gst_schro_dec_get_type (void);
GST_DEBUG_CATEGORY (schro_debug);
#define GST_CAT_DEFAULT schro_debug
static gboolean
plugin_init (GstPlugin * plugin)
{
schro_init ();
GST_DEBUG_CATEGORY_INIT (schro_debug, "schro", 0, "Schroedinger");
gst_element_register (plugin, "schrodec", GST_RANK_PRIMARY,
gst_schro_dec_get_type ());
gst_element_register (plugin, "schroenc", GST_RANK_PRIMARY,
gst_schro_enc_get_type ());
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
schro,
"Schroedinger plugin",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)

View file

@ -1,595 +0,0 @@
/* Schrodinger
* Copyright (C) 2006 David Schleef <ds@schleef.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/base/gstadapter.h>
#include <gst/video/video.h>
#include <gst/video/gstvideometa.h>
#include <gst/video/gstvideopool.h>
#include <gst/video/gstvideodecoder.h>
#include <string.h>
#include <math.h>
#include <schroedinger/schro.h>
#include "gstschroutils.h"
#include <schroedinger/schroparse.h>
GST_DEBUG_CATEGORY_EXTERN (schro_debug);
#define GST_CAT_DEFAULT schro_debug
#define GST_TYPE_SCHRO_DEC \
(gst_schro_dec_get_type())
#define GST_SCHRO_DEC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SCHRO_DEC,GstSchroDec))
#define GST_SCHRO_DEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SCHRO_DEC,GstSchroDecClass))
#define GST_IS_SCHRO_DEC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SCHRO_DEC))
#define GST_IS_SCHRO_DEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SCHRO_DEC))
typedef struct _GstSchroDec GstSchroDec;
typedef struct _GstSchroDecClass GstSchroDecClass;
struct _GstSchroDec
{
GstVideoDecoder base_video_decoder;
SchroDecoder *decoder;
gboolean seq_header_buffer_seen;
gint next;
gint prev;
gint parse_code;
gboolean header_read;
};
struct _GstSchroDecClass
{
GstVideoDecoderClass base_video_decoder_class;
};
GType gst_schro_dec_get_type (void);
/* GstSchroDec signals and args */
enum
{
LAST_SIGNAL
};
enum
{
ARG_0
};
static void gst_schro_dec_finalize (GObject * object);
static gboolean gst_schro_dec_start (GstVideoDecoder * dec);
static gboolean gst_schro_dec_stop (GstVideoDecoder * dec);
static gboolean gst_schro_dec_flush (GstVideoDecoder * dec);
static GstFlowReturn gst_schro_dec_parse (GstVideoDecoder *
base_video_decoder, GstVideoCodecFrame * frame, GstAdapter * adapter,
gboolean at_eos);
static GstFlowReturn gst_schro_dec_handle_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame);
static GstFlowReturn gst_schro_dec_finish (GstVideoDecoder * base_video_decoder);
static void gst_schrodec_send_tags (GstSchroDec * schro_dec);
static gboolean gst_schro_dec_decide_allocation (GstVideoDecoder * decoder,
GstQuery * query);
static GstStaticPadTemplate gst_schro_dec_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-dirac")
);
static GstStaticPadTemplate gst_schro_dec_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_SCHRO_YUV_LIST))
);
#define parent_class gst_schro_dec_parent_class
G_DEFINE_TYPE (GstSchroDec, gst_schro_dec, GST_TYPE_VIDEO_DECODER);
static void
gst_schro_dec_class_init (GstSchroDecClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *element_class;
GstVideoDecoderClass *base_video_decoder_class;
gobject_class = G_OBJECT_CLASS (klass);
element_class = GST_ELEMENT_CLASS (klass);
base_video_decoder_class = GST_VIDEO_DECODER_CLASS (klass);
gobject_class->finalize = gst_schro_dec_finalize;
gst_element_class_add_static_pad_template (element_class,
&gst_schro_dec_src_template);
gst_element_class_add_static_pad_template (element_class,
&gst_schro_dec_sink_template);
gst_element_class_set_static_metadata (element_class, "Dirac Decoder",
"Codec/Decoder/Video",
"Decode Dirac streams", "David Schleef <ds@schleef.org>");
base_video_decoder_class->start = GST_DEBUG_FUNCPTR (gst_schro_dec_start);
base_video_decoder_class->stop = GST_DEBUG_FUNCPTR (gst_schro_dec_stop);
base_video_decoder_class->flush = GST_DEBUG_FUNCPTR (gst_schro_dec_flush);
base_video_decoder_class->parse = GST_DEBUG_FUNCPTR (gst_schro_dec_parse);
base_video_decoder_class->handle_frame =
GST_DEBUG_FUNCPTR (gst_schro_dec_handle_frame);
base_video_decoder_class->finish = GST_DEBUG_FUNCPTR (gst_schro_dec_finish);
base_video_decoder_class->decide_allocation =
GST_DEBUG_FUNCPTR (gst_schro_dec_decide_allocation);
}
static void
gst_schro_dec_init (GstSchroDec * schro_dec)
{
GST_DEBUG ("gst_schro_dec_init");
schro_dec->decoder = schro_decoder_new ();
gst_video_decoder_set_packetized (GST_VIDEO_DECODER (schro_dec), FALSE);
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
(schro_dec), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (schro_dec));
schro_dec->header_read = FALSE;
}
static gboolean
gst_schro_dec_start (GstVideoDecoder * dec)
{
return TRUE;
}
static gboolean
gst_schro_dec_stop (GstVideoDecoder * dec)
{
GstSchroDec *schro_dec;
schro_dec = GST_SCHRO_DEC (dec);
schro_dec->header_read = FALSE;
return TRUE;
}
static gboolean
gst_schro_dec_flush (GstVideoDecoder * dec)
{
GstSchroDec *schro_dec;
schro_dec = GST_SCHRO_DEC (dec);
GST_DEBUG ("flush");
if (schro_dec->decoder)
schro_decoder_reset (schro_dec->decoder);
schro_dec->header_read = FALSE;
return TRUE;
}
static void
gst_schro_dec_finalize (GObject * object)
{
GstSchroDec *schro_dec;
g_return_if_fail (GST_IS_SCHRO_DEC (object));
schro_dec = GST_SCHRO_DEC (object);
if (schro_dec->decoder) {
schro_decoder_free (schro_dec->decoder);
schro_dec->decoder = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
parse_sequence_header (GstSchroDec * schro_dec, guint8 * data, int size)
{
SchroVideoFormat video_format;
int ret;
GstVideoCodecState *state = NULL;
int bit_depth;
GstVideoFormat fmt = GST_VIDEO_FORMAT_UNKNOWN;
GST_DEBUG_OBJECT (schro_dec, "parse_sequence_header size=%d", size);
schro_dec->seq_header_buffer_seen = TRUE;
ret = schro_parse_decode_sequence_header (data + 13, size - 13,
&video_format);
if (!ret) {
/* FIXME : Isn't this meant to be a *fatal* error ? */
GST_WARNING ("Failed to get frame rate from sequence header");
goto beach;
}
#if SCHRO_CHECK_VERSION(1,0,11)
bit_depth = schro_video_format_get_bit_depth (&video_format);
#else
bit_depth = 8;
#endif
if (bit_depth == 8) {
if (video_format.chroma_format == SCHRO_CHROMA_444) {
fmt = GST_VIDEO_FORMAT_AYUV;
} else if (video_format.chroma_format == SCHRO_CHROMA_422) {
fmt = GST_VIDEO_FORMAT_UYVY;
} else if (video_format.chroma_format == SCHRO_CHROMA_420) {
fmt = GST_VIDEO_FORMAT_I420;
}
#if SCHRO_CHECK_VERSION(1,0,11)
} else if (bit_depth <= 10) {
if (video_format.colour_matrix == SCHRO_COLOUR_MATRIX_REVERSIBLE) {
fmt = GST_VIDEO_FORMAT_ARGB;
} else {
fmt = GST_VIDEO_FORMAT_v210;
}
} else if (bit_depth <= 16) {
fmt = GST_VIDEO_FORMAT_AYUV64;
} else {
GST_ERROR ("bit depth too large (%d > 16)", bit_depth);
fmt = GST_VIDEO_FORMAT_AYUV64;
#endif
}
state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (schro_dec),
fmt, video_format.width, video_format.height, NULL);
GST_DEBUG ("Frame dimensions are %d x %d\n", state->info.width,
state->info.height);
state->info.fps_n = video_format.frame_rate_numerator;
state->info.fps_d = video_format.frame_rate_denominator;
GST_DEBUG_OBJECT (schro_dec, "Frame rate is %d/%d", state->info.fps_n,
state->info.fps_d);
state->info.par_n = video_format.aspect_ratio_numerator;
state->info.par_d = video_format.aspect_ratio_denominator;
GST_DEBUG ("Pixel aspect ratio is %d/%d", state->info.par_n,
state->info.par_d);
gst_video_decoder_negotiate (GST_VIDEO_DECODER (schro_dec));
beach:
if (state)
gst_video_codec_state_unref (state);
gst_schrodec_send_tags (schro_dec);
}
static GstFlowReturn
gst_schro_dec_parse (GstVideoDecoder * base_video_decoder,
GstVideoCodecFrame * frame, GstAdapter * adapter, gboolean at_eos)
{
GstSchroDec *schro_decoder;
unsigned char header[SCHRO_PARSE_HEADER_SIZE];
int av, loc;
GST_DEBUG_OBJECT (base_video_decoder, "parse");
schro_decoder = GST_SCHRO_DEC (base_video_decoder);
av = gst_adapter_available (adapter);
if (av < SCHRO_PARSE_HEADER_SIZE) {
return GST_VIDEO_DECODER_FLOW_NEED_DATA;
}
GST_DEBUG ("available %d", av);
/* Check for header */
if (schro_decoder->header_read == FALSE) {
/* Check for header */
loc =
gst_adapter_masked_scan_uint32 (adapter, 0xffffffff, 0x42424344, 0,
av - (SCHRO_PARSE_HEADER_SIZE - 1));
if (G_UNLIKELY (loc == -1)) {
GST_DEBUG_OBJECT (schro_decoder, "No header");
gst_adapter_flush (adapter, av - (SCHRO_PARSE_HEADER_SIZE - 1));
return GST_VIDEO_DECODER_FLOW_NEED_DATA;
}
/* Skip data until header */
if (loc > 0)
gst_adapter_flush (adapter, loc);
gst_adapter_copy (adapter, header, 0, SCHRO_PARSE_HEADER_SIZE);
schro_decoder->parse_code = header[4];
schro_decoder->next = GST_READ_UINT32_BE (header + 5);
schro_decoder->prev = GST_READ_UINT32_BE (header + 9);
GST_DEBUG ("%08x %02x %08x %08x",
GST_READ_UINT32_BE (header), schro_decoder->parse_code,
schro_decoder->next, schro_decoder->prev);
if (memcmp (header, "BBCD", 4) != 0 || (schro_decoder->next & 0xf0000000)
|| (schro_decoder->prev & 0xf0000000)) {
gst_adapter_flush (adapter, 1);
return GST_VIDEO_DECODER_FLOW_NEED_DATA;
}
schro_decoder->header_read = TRUE;
}
if (SCHRO_PARSE_CODE_IS_END_OF_SEQUENCE (schro_decoder->parse_code)) {
if (schro_decoder->next != 0
&& schro_decoder->next != SCHRO_PARSE_HEADER_SIZE) {
GST_WARNING ("next is not 0 or 13 in EOS packet (%d)",
schro_decoder->next);
}
gst_video_decoder_add_to_frame (base_video_decoder,
SCHRO_PARSE_HEADER_SIZE);
SCHRO_DEBUG ("eos");
schro_decoder->header_read = FALSE;
return gst_video_decoder_have_frame (base_video_decoder);
}
if (gst_adapter_available (adapter) < schro_decoder->next) {
return GST_VIDEO_DECODER_FLOW_NEED_DATA;
} else
schro_decoder->header_read = FALSE;
if (SCHRO_PARSE_CODE_IS_SEQ_HEADER (schro_decoder->parse_code)) {
guint8 *data;
data = g_malloc (schro_decoder->next);
gst_adapter_copy (adapter, data, 0, schro_decoder->next);
parse_sequence_header (schro_decoder, data, schro_decoder->next);
GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame);
#if 0
if (GST_CLOCK_TIME_IS_VALID (base_video_decoder->last_sink_timestamp)) {
base_video_decoder->current_frame->pts =
base_video_decoder->last_sink_timestamp;
GST_DEBUG ("got timestamp %" G_GINT64_FORMAT,
base_video_decoder->last_sink_timestamp);
} else if (base_video_decoder->last_sink_offset_end != -1) {
GstVideoCodecState *state;
#if 0
/* FIXME perhaps should use this to determine if the granulepos
* is valid */
{
guint64 pt;
int dist_h;
int dist_l;
int dist;
int delay;
guint64 dt;
gint64 granulepos = base_video_decoder->last_sink_offset_end;
pt = ((granulepos >> 22) +
(granulepos & OGG_DIRAC_GRANULE_LOW_MASK)) >> 9;
dist_h = (granulepos >> 22) & 0xff;
dist_l = granulepos & 0xff;
dist = (dist_h << 8) | dist_l;
delay = (granulepos >> 9) & 0x1fff;
dt = pt - delay;
GST_DEBUG ("gp pt %lld dist %d delay %d dt %lld", pt, dist, delay, dt);
}
#endif
state = gst_video_decoder_get_state (base_video_decoder);
base_video_decoder->current_frame->pts =
gst_util_uint64_scale (granulepos_to_frame
(base_video_decoder->last_sink_offset_end), state->fps_d * GST_SECOND,
state->fps_n);
} else {
base_video_decoder->current_frame->pts = -1;
}
#endif
g_free (data);
}
if (!schro_decoder->seq_header_buffer_seen) {
gst_adapter_flush (adapter, schro_decoder->next);
return GST_FLOW_OK;
}
if (SCHRO_PARSE_CODE_IS_PICTURE (schro_decoder->parse_code)) {
guint8 tmp[4];
gst_adapter_copy (adapter, tmp, SCHRO_PARSE_HEADER_SIZE, 4);
/* What is the point of this ? BaseVideoDecoder doesn't
* do anything with presentation_frame_number */
frame->presentation_frame_number = GST_READ_UINT32_BE (tmp);
gst_video_decoder_add_to_frame (base_video_decoder, schro_decoder->next);
return gst_video_decoder_have_frame (base_video_decoder);
} else {
gst_video_decoder_add_to_frame (base_video_decoder, schro_decoder->next);
}
return GST_FLOW_OK;
}
static void
gst_schrodec_send_tags (GstSchroDec * schro_dec)
{
GstTagList *list;
list = gst_tag_list_new_empty ();
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_VIDEO_CODEC, "Dirac", NULL);
gst_pad_push_event (GST_VIDEO_DECODER_SRC_PAD (schro_dec),
gst_event_new_tag (list));
}
static GstFlowReturn
gst_schro_dec_process (GstSchroDec * schro_dec, gboolean eos)
{
gboolean go;
GstFlowReturn ret;
ret = GST_FLOW_OK;
go = TRUE;
while (go) {
int it;
it = schro_decoder_autoparse_wait (schro_dec->decoder);
switch (it) {
case SCHRO_DECODER_FIRST_ACCESS_UNIT:
break;
case SCHRO_DECODER_NEED_BITS:
GST_DEBUG ("need bits");
go = 0;
break;
case SCHRO_DECODER_NEED_FRAME:
{
GstBuffer *outbuf;
GstVideoCodecState *state;
SchroFrame *schro_frame;
GST_DEBUG ("need frame");
state =
gst_video_decoder_get_output_state (GST_VIDEO_DECODER (schro_dec));
outbuf =
gst_video_decoder_allocate_output_buffer (GST_VIDEO_DECODER
(schro_dec));
schro_frame = gst_schro_buffer_wrap (outbuf, TRUE, &state->info);
schro_decoder_add_output_picture (schro_dec->decoder, schro_frame);
gst_video_codec_state_unref (state);
break;
}
case SCHRO_DECODER_OK:
{
SchroFrame *schro_frame;
SchroTag *tag;
GstVideoCodecFrame *frame;
GST_DEBUG ("got frame");
tag = schro_decoder_get_picture_tag (schro_dec->decoder);
schro_frame = schro_decoder_pull (schro_dec->decoder);
frame = tag->value;
if (schro_frame) {
if ((frame->output_buffer = gst_schro_frame_get_buffer (schro_frame))) {
GstFlowReturn flow_ret;
flow_ret =
gst_video_decoder_finish_frame (GST_VIDEO_DECODER
(schro_dec), frame);
if (flow_ret != GST_FLOW_OK) {
GST_DEBUG ("finish frame returned %d", flow_ret);
return flow_ret;
}
} else {
GST_DEBUG ("skipped frame");
}
schro_frame_unref (schro_frame);
}
schro_tag_free (tag);
if (!eos) {
go = FALSE;
}
}
break;
case SCHRO_DECODER_EOS:
GST_DEBUG ("eos");
go = FALSE;
break;
case SCHRO_DECODER_ERROR:
go = FALSE;
GST_DEBUG ("codec error");
ret = GST_FLOW_ERROR;
break;
default:
break;
}
}
return ret;
}
GstFlowReturn
gst_schro_dec_handle_frame (GstVideoDecoder * base_video_decoder,
GstVideoCodecFrame * frame)
{
GstSchroDec *schro_dec;
SchroBuffer *input_buffer;
schro_dec = GST_SCHRO_DEC (base_video_decoder);
GST_DEBUG ("handle frame");
input_buffer = gst_schro_wrap_gst_buffer (frame->input_buffer);
frame->input_buffer = NULL;
input_buffer->tag = schro_tag_new (frame, NULL);
schro_decoder_autoparse_push (schro_dec->decoder, input_buffer);
return gst_schro_dec_process (schro_dec, FALSE);
}
GstFlowReturn
gst_schro_dec_finish (GstVideoDecoder * base_video_decoder)
{
GstSchroDec *schro_dec;
schro_dec = GST_SCHRO_DEC (base_video_decoder);
GST_DEBUG ("finish");
schro_decoder_autoparse_push_end_of_sequence (schro_dec->decoder);
return gst_schro_dec_process (schro_dec, TRUE);
}
static gboolean
gst_schro_dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
{
GstBufferPool *pool;
GstStructure *config;
if (!GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (decoder,
query))
return FALSE;
gst_query_parse_nth_allocation_pool (query, 0, &pool, NULL, NULL, NULL);
config = gst_buffer_pool_get_config (pool);
if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL)) {
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_META);
}
gst_buffer_pool_set_config (pool, config);
gst_object_unref (pool);
return TRUE;
}

View file

@ -1,795 +0,0 @@
/* Schrodinger
* Copyright (C) 2006 David Schleef <ds@schleef.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideometa.h>
#include <gst/video/gstvideoencoder.h>
#include <gst/video/gstvideoutils.h>
#include <string.h>
#include <math.h>
#include <schroedinger/schro.h>
#include <schroedinger/schrobitstream.h>
#include <schroedinger/schrovirtframe.h>
#include "gstschroutils.h"
GST_DEBUG_CATEGORY_EXTERN (schro_debug);
#define GST_CAT_DEFAULT schro_debug
#define GST_TYPE_SCHRO_ENC \
(gst_schro_enc_get_type())
#define GST_SCHRO_ENC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SCHRO_ENC,GstSchroEnc))
#define GST_SCHRO_ENC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SCHRO_ENC,GstSchroEncClass))
#define GST_IS_SCHRO_ENC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SCHRO_ENC))
#define GST_IS_SCHRO_ENC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SCHRO_ENC))
typedef struct _GstSchroEnc GstSchroEnc;
typedef struct _GstSchroEncClass GstSchroEncClass;
struct _GstSchroEnc
{
GstVideoEncoder base_encoder;
GstPad *sinkpad;
GstPad *srcpad;
/* state */
SchroEncoder *encoder;
SchroVideoFormat *video_format;
guint64 last_granulepos;
guint64 granule_offset;
GstVideoCodecState *input_state;
};
struct _GstSchroEncClass
{
GstVideoEncoderClass parent_class;
};
GType gst_schro_enc_get_type (void);
enum
{
LAST_SIGNAL
};
enum
{
ARG_0
};
static void gst_schro_enc_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_schro_enc_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstFlowReturn gst_schro_enc_process (GstSchroEnc * schro_enc);
static gboolean gst_schro_enc_set_format (GstVideoEncoder *
base_video_encoder, GstVideoCodecState * state);
static gboolean gst_schro_enc_start (GstVideoEncoder * base_video_encoder);
static gboolean gst_schro_enc_stop (GstVideoEncoder * base_video_encoder);
static GstFlowReturn gst_schro_enc_finish (GstVideoEncoder *
base_video_encoder);
static GstFlowReturn gst_schro_enc_handle_frame (GstVideoEncoder *
base_video_encoder, GstVideoCodecFrame * frame);
static GstFlowReturn gst_schro_enc_pre_push (GstVideoEncoder *
base_video_encoder, GstVideoCodecFrame * frame);
static void gst_schro_enc_finalize (GObject * object);
static gboolean gst_schro_enc_propose_allocation (GstVideoEncoder * encoder,
GstQuery * query);
static GstStaticPadTemplate gst_schro_enc_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_SCHRO_YUV_LIST))
);
static GstStaticPadTemplate gst_schro_enc_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-dirac;video/x-qt-part;video/x-mp4-part")
);
#define parent_class gst_schro_enc_parent_class
G_DEFINE_TYPE (GstSchroEnc, gst_schro_enc, GST_TYPE_VIDEO_ENCODER);
static GType
register_enum_list (const SchroEncoderSetting * setting)
{
GType type;
static GEnumValue *enumtypes;
int n;
char *typename;
int i;
n = setting->max + 1;
enumtypes = g_malloc0 ((n + 1) * sizeof (GEnumValue));
for (i = 0; i < n; i++) {
gchar *nick;
enumtypes[i].value = i;
nick = g_strdelimit (g_strdup (setting->enum_list[i]), "_", '-');
enumtypes[i].value_name = g_intern_static_string (nick);
enumtypes[i].value_nick = enumtypes[i].value_name;
}
typename = g_strdup_printf ("SchroEncoderSettingEnum_%s", setting->name);
type = g_enum_register_static (typename, enumtypes);
g_free (typename);
return type;
}
static void
gst_schro_enc_class_init (GstSchroEncClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *element_class;
GstVideoEncoderClass *basevideocoder_class;
int i;
gobject_class = G_OBJECT_CLASS (klass);
element_class = GST_ELEMENT_CLASS (klass);
basevideocoder_class = GST_VIDEO_ENCODER_CLASS (klass);
gobject_class->set_property = gst_schro_enc_set_property;
gobject_class->get_property = gst_schro_enc_get_property;
gobject_class->finalize = gst_schro_enc_finalize;
for (i = 0; i < schro_encoder_get_n_settings (); i++) {
const SchroEncoderSetting *setting;
setting = schro_encoder_get_setting_info (i);
/* we do this by checking downstream caps, and the profile/level selected
* should be read from the output caps and not from properties */
if (strcmp (setting->name, "force_profile") == 0
|| strcmp (setting->name, "profile") == 0
|| strcmp (setting->name, "level") == 0)
continue;
/* we configure this based on the input caps */
if (strcmp (setting->name, "interlaced_coding") == 0)
continue;
switch (setting->type) {
case SCHRO_ENCODER_SETTING_TYPE_BOOLEAN:
g_object_class_install_property (gobject_class, i + 1,
g_param_spec_boolean (setting->name, setting->name, setting->name,
setting->default_value, G_PARAM_READWRITE));
break;
case SCHRO_ENCODER_SETTING_TYPE_INT:
g_object_class_install_property (gobject_class, i + 1,
g_param_spec_int (setting->name, setting->name, setting->name,
setting->min, setting->max, setting->default_value,
G_PARAM_READWRITE));
break;
case SCHRO_ENCODER_SETTING_TYPE_ENUM:
g_object_class_install_property (gobject_class, i + 1,
g_param_spec_enum (setting->name, setting->name, setting->name,
register_enum_list (setting), setting->default_value,
G_PARAM_READWRITE));
break;
case SCHRO_ENCODER_SETTING_TYPE_DOUBLE:
g_object_class_install_property (gobject_class, i + 1,
g_param_spec_double (setting->name, setting->name, setting->name,
setting->min, setting->max, setting->default_value,
G_PARAM_READWRITE));
break;
default:
break;
}
}
gst_element_class_add_static_pad_template (element_class,
&gst_schro_enc_src_template);
gst_element_class_add_static_pad_template (element_class,
&gst_schro_enc_sink_template);
gst_element_class_set_static_metadata (element_class, "Dirac Encoder",
"Codec/Encoder/Video",
"Encode raw video into Dirac stream", "David Schleef <ds@schleef.org>");
basevideocoder_class->set_format =
GST_DEBUG_FUNCPTR (gst_schro_enc_set_format);
basevideocoder_class->start = GST_DEBUG_FUNCPTR (gst_schro_enc_start);
basevideocoder_class->stop = GST_DEBUG_FUNCPTR (gst_schro_enc_stop);
basevideocoder_class->finish = GST_DEBUG_FUNCPTR (gst_schro_enc_finish);
basevideocoder_class->handle_frame =
GST_DEBUG_FUNCPTR (gst_schro_enc_handle_frame);
basevideocoder_class->pre_push = GST_DEBUG_FUNCPTR (gst_schro_enc_pre_push);
basevideocoder_class->propose_allocation =
GST_DEBUG_FUNCPTR (gst_schro_enc_propose_allocation);
}
static void
gst_schro_enc_init (GstSchroEnc * schro_enc)
{
GST_DEBUG ("gst_schro_enc_init");
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_ENCODER_SINK_PAD (schro_enc));
/* Normally, we'd create the encoder in ->start(), but we use the
* encoder to store object properties. So it needs to be created
* here. */
schro_enc->encoder = schro_encoder_new ();
schro_encoder_set_packet_assembly (schro_enc->encoder, TRUE);
schro_enc->video_format = schro_encoder_get_video_format (schro_enc->encoder);
}
static void
gst_schro_enc_finalize (GObject * object)
{
GstSchroEnc *schro_enc = GST_SCHRO_ENC (object);
if (schro_enc->encoder) {
schro_encoder_free (schro_enc->encoder);
schro_enc->encoder = NULL;
}
if (schro_enc->video_format) {
g_free (schro_enc->video_format);
schro_enc->video_format = NULL;
}
if (schro_enc->input_state)
gst_video_codec_state_unref (schro_enc->input_state);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static const gchar *
get_profile_name (int profile)
{
switch (profile) {
case 0:
return "vc2-low-delay";
case 1:
return "vc2-simple";
case 2:
return "vc2-main";
case 8:
return "main";
default:
break;
}
return "unknown";
}
static const gchar *
get_level_name (int level)
{
switch (level) {
case 0:
return "0";
case 1:
return "1";
case 128:
return "128";
default:
break;
}
/* need to add it to template caps, so return 0 for now */
GST_WARNING ("unhandled dirac level %u", level);
return "0";
}
static void
gst_schro_enc_negotiate_profile (GstSchroEnc * enc)
{
GstStructure *s;
const gchar *profile;
const gchar *level;
GstCaps *allowed_caps;
allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (enc));
GST_DEBUG_OBJECT (enc, "allowed caps: %" GST_PTR_FORMAT, allowed_caps);
if (allowed_caps == NULL)
return;
if (gst_caps_is_empty (allowed_caps) || gst_caps_is_any (allowed_caps))
goto out;
allowed_caps = gst_caps_make_writable (allowed_caps);
allowed_caps = gst_caps_fixate (allowed_caps);
s = gst_caps_get_structure (allowed_caps, 0);
profile = gst_structure_get_string (s, "profile");
if (profile) {
if (!strcmp (profile, "vc2-low-delay")) {
schro_encoder_setting_set_double (enc->encoder, "force_profile", 1);
} else if (!strcmp (profile, "vc2-simple")) {
schro_encoder_setting_set_double (enc->encoder, "force_profile", 2);
} else if (!strcmp (profile, "vc2-main")) {
schro_encoder_setting_set_double (enc->encoder, "force_profile", 3);
} else if (!strcmp (profile, "main")) {
schro_encoder_setting_set_double (enc->encoder, "force_profile", 4);
} else {
GST_WARNING_OBJECT (enc, "ignoring unknown profile '%s'", profile);
}
}
level = gst_structure_get_string (s, "level");
if (level != NULL && strcmp (level, "0") != 0) {
GST_FIXME_OBJECT (enc, "level setting not implemented");
}
out:
gst_caps_unref (allowed_caps);
}
static gboolean
gst_schro_enc_set_format (GstVideoEncoder * base_video_encoder,
GstVideoCodecState * state)
{
GstSchroEnc *schro_enc = GST_SCHRO_ENC (base_video_encoder);
GstBuffer *seq_header_buffer;
GstVideoInfo *info = &state->info;
GstVideoCodecState *output_state;
GstClockTime latency;
GstCaps *out_caps;
int level, profile;
GST_DEBUG ("set_output_caps");
schro_video_format_set_std_video_format (schro_enc->video_format,
SCHRO_VIDEO_FORMAT_CUSTOM);
switch (GST_VIDEO_INFO_FORMAT (info)) {
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_Y42B:
#endif
schro_enc->video_format->chroma_format = SCHRO_CHROMA_420;
break;
case GST_VIDEO_FORMAT_YUY2:
case GST_VIDEO_FORMAT_UYVY:
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_v216:
case GST_VIDEO_FORMAT_v210:
#endif
schro_enc->video_format->chroma_format = SCHRO_CHROMA_422;
break;
case GST_VIDEO_FORMAT_AYUV:
#if SCHRO_CHECK_VERSION(1,0,12)
case GST_VIDEO_FORMAT_ARGB:
#endif
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_Y444:
case GST_VIDEO_FORMAT_AYUV64:
#endif
schro_enc->video_format->chroma_format = SCHRO_CHROMA_444;
break;
default:
g_assert_not_reached ();
}
schro_enc->video_format->frame_rate_numerator = GST_VIDEO_INFO_FPS_N (info);
schro_enc->video_format->frame_rate_denominator = GST_VIDEO_INFO_FPS_D (info);
/* Seems that schroenc doesn't like unknown framerates, so let's pick
* the random value 30 FPS if the framerate is unknown.
*/
if (schro_enc->video_format->frame_rate_denominator == 0 ||
schro_enc->video_format->frame_rate_numerator == 0) {
schro_enc->video_format->frame_rate_numerator = 30;
schro_enc->video_format->frame_rate_denominator = 1;
}
schro_enc->video_format->width = GST_VIDEO_INFO_WIDTH (info);
schro_enc->video_format->height = GST_VIDEO_INFO_HEIGHT (info);
schro_enc->video_format->clean_width = GST_VIDEO_INFO_WIDTH (info);
schro_enc->video_format->clean_height = GST_VIDEO_INFO_HEIGHT (info);
schro_enc->video_format->left_offset = 0;
schro_enc->video_format->top_offset = 0;
schro_enc->video_format->aspect_ratio_numerator = GST_VIDEO_INFO_PAR_N (info);
schro_enc->video_format->aspect_ratio_denominator =
GST_VIDEO_INFO_PAR_D (info);
switch (GST_VIDEO_INFO_FORMAT (&state->info)) {
default:
schro_video_format_set_std_signal_range (schro_enc->video_format,
SCHRO_SIGNAL_RANGE_8BIT_VIDEO);
break;
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_v210:
schro_video_format_set_std_signal_range (schro_enc->video_format,
SCHRO_SIGNAL_RANGE_10BIT_VIDEO);
break;
case GST_VIDEO_FORMAT_v216:
case GST_VIDEO_FORMAT_AYUV64:
schro_enc->video_format->luma_offset = 64 << 8;
schro_enc->video_format->luma_excursion = 219 << 8;
schro_enc->video_format->chroma_offset = 128 << 8;
schro_enc->video_format->chroma_excursion = 224 << 8;
break;
#endif
#if SCHRO_CHECK_VERSION(1,0,12)
case GST_VIDEO_FORMAT_ARGB:
schro_enc->video_format->luma_offset = 256;
schro_enc->video_format->luma_excursion = 511;
schro_enc->video_format->chroma_offset = 256;
schro_enc->video_format->chroma_excursion = 511;
break;
#endif
}
if (GST_VIDEO_INFO_IS_INTERLACED (&state->info)) {
schro_enc->video_format->interlaced_coding = 1;
}
/* See if downstream caps specify profile/level */
gst_schro_enc_negotiate_profile (schro_enc);
/* Finally set latency */
latency = gst_util_uint64_scale (GST_SECOND,
schro_enc->video_format->frame_rate_denominator *
(int) schro_encoder_setting_get_double (schro_enc->encoder,
"queue_depth"), schro_enc->video_format->frame_rate_numerator);
gst_video_encoder_set_latency (base_video_encoder, latency, latency);
schro_video_format_set_std_colour_spec (schro_enc->video_format,
SCHRO_COLOUR_SPEC_HDTV);
schro_encoder_set_video_format (schro_enc->encoder, schro_enc->video_format);
schro_encoder_start (schro_enc->encoder);
seq_header_buffer =
gst_schro_wrap_schro_buffer (schro_encoder_encode_sequence_header
(schro_enc->encoder));
schro_enc->granule_offset = ~0;
profile = schro_encoder_setting_get_double (schro_enc->encoder, "profile");
level = schro_encoder_setting_get_double (schro_enc->encoder, "level");
out_caps = gst_caps_new_simple ("video/x-dirac",
"profile", G_TYPE_STRING, get_profile_name (profile),
"level", G_TYPE_STRING, get_level_name (level), NULL);
output_state =
gst_video_encoder_set_output_state (base_video_encoder, out_caps, state);
GST_BUFFER_FLAG_SET (seq_header_buffer, GST_BUFFER_FLAG_HEADER);
{
GValue array = { 0 };
GValue value = { 0 };
guint8 *outdata;
GstBuffer *buf;
GstMemory *seq_header_memory, *extra_header;
gsize size;
g_value_init (&array, GST_TYPE_ARRAY);
g_value_init (&value, GST_TYPE_BUFFER);
buf = gst_buffer_new ();
/* Add the sequence header */
seq_header_memory = gst_buffer_get_memory (seq_header_buffer, 0);
gst_buffer_append_memory (buf, seq_header_memory);
size = gst_buffer_get_size (buf) + SCHRO_PARSE_HEADER_SIZE;
outdata = g_malloc0 (SCHRO_PARSE_HEADER_SIZE);
GST_WRITE_UINT32_BE (outdata, 0x42424344);
GST_WRITE_UINT8 (outdata + 4, SCHRO_PARSE_CODE_END_OF_SEQUENCE);
GST_WRITE_UINT32_BE (outdata + 5, 0);
GST_WRITE_UINT32_BE (outdata + 9, size);
extra_header = gst_memory_new_wrapped (0, outdata, SCHRO_PARSE_HEADER_SIZE,
0, SCHRO_PARSE_HEADER_SIZE, outdata, g_free);
gst_buffer_append_memory (buf, extra_header);
/* ogg(mux) expects the header buffers to have 0 timestamps -
set OFFSET and OFFSET_END accordingly */
GST_BUFFER_OFFSET (buf) = 0;
GST_BUFFER_OFFSET_END (buf) = 0;
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER);
gst_value_set_buffer (&value, buf);
gst_buffer_unref (buf);
gst_value_array_append_value (&array, &value);
gst_structure_set_value (gst_caps_get_structure (output_state->caps, 0),
"streamheader", &array);
g_value_unset (&value);
g_value_unset (&array);
}
gst_buffer_unref (seq_header_buffer);
gst_video_codec_state_unref (output_state);
/* And save the input state for later use */
if (schro_enc->input_state)
gst_video_codec_state_unref (schro_enc->input_state);
schro_enc->input_state = gst_video_codec_state_ref (state);
return TRUE;
}
static void
gst_schro_enc_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstSchroEnc *src;
src = GST_SCHRO_ENC (object);
GST_DEBUG ("%s", pspec->name);
if (prop_id >= 1) {
const SchroEncoderSetting *setting;
setting = schro_encoder_get_setting_info (prop_id - 1);
switch (G_VALUE_TYPE (value)) {
case G_TYPE_DOUBLE:
schro_encoder_setting_set_double (src->encoder, setting->name,
g_value_get_double (value));
break;
case G_TYPE_INT:
schro_encoder_setting_set_double (src->encoder, setting->name,
g_value_get_int (value));
break;
case G_TYPE_BOOLEAN:
schro_encoder_setting_set_double (src->encoder, setting->name,
g_value_get_boolean (value));
break;
default:
schro_encoder_setting_set_double (src->encoder, setting->name,
g_value_get_enum (value));
break;
}
}
}
static void
gst_schro_enc_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstSchroEnc *src;
src = GST_SCHRO_ENC (object);
if (prop_id >= 1) {
const SchroEncoderSetting *setting;
setting = schro_encoder_get_setting_info (prop_id - 1);
switch (G_VALUE_TYPE (value)) {
case G_TYPE_DOUBLE:
g_value_set_double (value,
schro_encoder_setting_get_double (src->encoder, setting->name));
break;
case G_TYPE_INT:
g_value_set_int (value,
schro_encoder_setting_get_double (src->encoder, setting->name));
break;
case G_TYPE_BOOLEAN:
g_value_set_boolean (value,
schro_encoder_setting_get_double (src->encoder, setting->name));
break;
default:
/* it's an enum */
g_value_set_enum (value,
schro_encoder_setting_get_double (src->encoder, setting->name));
break;
}
}
}
static gboolean
gst_schro_enc_start (GstVideoEncoder * base_video_encoder)
{
return TRUE;
}
static gboolean
gst_schro_enc_stop (GstVideoEncoder * base_video_encoder)
{
return TRUE;
}
static GstFlowReturn
gst_schro_enc_finish (GstVideoEncoder * base_video_encoder)
{
GstSchroEnc *schro_enc = GST_SCHRO_ENC (base_video_encoder);
GST_DEBUG ("finish");
schro_encoder_end_of_stream (schro_enc->encoder);
gst_schro_enc_process (schro_enc);
return GST_FLOW_OK;
}
static GstFlowReturn
gst_schro_enc_handle_frame (GstVideoEncoder * base_video_encoder,
GstVideoCodecFrame * frame)
{
GstSchroEnc *schro_enc = GST_SCHRO_ENC (base_video_encoder);
SchroFrame *schro_frame;
GstFlowReturn ret;
GstVideoInfo *info = &schro_enc->input_state->info;
if (schro_enc->granule_offset == ~0LL) {
schro_enc->granule_offset =
gst_util_uint64_scale (frame->pts, 2 * GST_VIDEO_INFO_FPS_N (info),
GST_SECOND * GST_VIDEO_INFO_FPS_D (info));
GST_DEBUG ("granule offset %" G_GINT64_FORMAT, schro_enc->granule_offset);
}
schro_frame = gst_schro_buffer_wrap (frame->input_buffer, FALSE, info);
GST_DEBUG ("pushing frame %p", frame);
schro_encoder_push_frame_full (schro_enc->encoder, schro_frame, frame);
ret = gst_schro_enc_process (schro_enc);
return ret;
}
static GstFlowReturn
gst_schro_enc_pre_push (GstVideoEncoder * base_video_encoder,
GstVideoCodecFrame * frame)
{
GstSchroEnc *schro_enc;
int delay;
int dist;
int pt;
int dt;
guint64 granulepos_hi;
guint64 granulepos_low;
GstBuffer *buf = frame->output_buffer;
schro_enc = GST_SCHRO_ENC (base_video_encoder);
pt = frame->presentation_frame_number * 2 + schro_enc->granule_offset;
dt = frame->decode_frame_number * 2 + schro_enc->granule_offset;
delay = pt - dt;
dist = frame->distance_from_sync;
GST_DEBUG ("sys %d dpn %d pt %d dt %d delay %d dist %d",
(int) frame->system_frame_number,
(int) frame->decode_frame_number, pt, dt, delay, dist);
granulepos_hi = (((guint64) pt - delay) << 9) | ((dist >> 8));
granulepos_low = (delay << 9) | (dist & 0xff);
GST_DEBUG ("granulepos %" G_GINT64_FORMAT ":%" G_GINT64_FORMAT, granulepos_hi,
granulepos_low);
#if 0
if (frame->is_eos) {
GST_BUFFER_OFFSET_END (buf) = schro_enc->last_granulepos;
} else {
#endif
schro_enc->last_granulepos = (granulepos_hi << 22) | (granulepos_low);
GST_BUFFER_OFFSET_END (buf) = schro_enc->last_granulepos;
#if 0
}
#endif
GST_BUFFER_OFFSET (buf) = gst_util_uint64_scale (schro_enc->last_granulepos,
GST_SECOND * schro_enc->video_format->frame_rate_denominator,
schro_enc->video_format->frame_rate_numerator);
return GST_FLOW_OK;
}
static gboolean
gst_schro_enc_propose_allocation (GstVideoEncoder * encoder, GstQuery * query)
{
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
return GST_VIDEO_ENCODER_CLASS (parent_class)->propose_allocation (encoder,
query);
}
static GstFlowReturn
gst_schro_enc_process (GstSchroEnc * schro_enc)
{
SchroBuffer *encoded_buffer;
GstVideoCodecFrame *frame;
GstFlowReturn ret;
int presentation_frame;
void *voidptr;
GstVideoEncoder *base_video_encoder = GST_VIDEO_ENCODER (schro_enc);
GST_DEBUG ("process");
while (1) {
switch (schro_encoder_wait (schro_enc->encoder)) {
case SCHRO_STATE_NEED_FRAME:
return GST_FLOW_OK;
case SCHRO_STATE_END_OF_STREAM:
GST_DEBUG ("EOS");
return GST_FLOW_OK;
case SCHRO_STATE_HAVE_BUFFER:
voidptr = NULL;
encoded_buffer = schro_encoder_pull_full (schro_enc->encoder,
&presentation_frame, &voidptr);
frame = voidptr;
if (encoded_buffer == NULL) {
GST_DEBUG ("encoder_pull returned NULL");
/* FIXME This shouldn't happen */
return GST_FLOW_ERROR;
}
#if SCHRO_CHECK_VERSION (1, 0, 9)
{
GstMessage *message;
GstStructure *structure;
GstBuffer *buf;
gpointer data;
data = g_malloc (sizeof (double) * 21);
schro_encoder_get_frame_stats (schro_enc->encoder,
(double *) data, 21);
buf = gst_buffer_new_wrapped (data, sizeof (double) * 21);
structure = gst_structure_new ("GstSchroEnc",
"frame-stats", GST_TYPE_BUFFER, buf, NULL);
gst_buffer_unref (buf);
message = gst_message_new_element (GST_OBJECT (schro_enc), structure);
gst_element_post_message (GST_ELEMENT (schro_enc), message);
}
#endif
if (voidptr == NULL) {
GST_DEBUG ("got eos");
//frame = schro_enc->eos_frame;
frame = NULL;
schro_buffer_unref (encoded_buffer);
}
/* FIXME: Get the frame from somewhere somehow... */
if (frame) {
if (SCHRO_PARSE_CODE_IS_SEQ_HEADER (encoded_buffer->data[4])) {
GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame);
}
frame->output_buffer = gst_schro_wrap_schro_buffer (encoded_buffer);
ret = gst_video_encoder_finish_frame (base_video_encoder, frame);
if (ret != GST_FLOW_OK) {
GST_DEBUG ("pad_push returned %d", ret);
return ret;
}
}
break;
case SCHRO_STATE_AGAIN:
break;
}
}
return GST_FLOW_OK;
}

View file

@ -1,224 +0,0 @@
/* Schrodinger
* Copyright (C) 2008 David Schleef <ds@schleef.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h>
#include "gstschroutils.h"
//#define SCHRO_ENABLE_UNSTABLE_API
#include <gst/gst.h>
#include <gst/video/video.h>
#include <schroedinger/schro.h>
#include <schroedinger/schrobitstream.h>
#include <schroedinger/schrovirtframe.h>
#include <string.h>
GST_DEBUG_CATEGORY_EXTERN (schro_debug);
#define GST_CAT_DEFAULT schro_debug
typedef struct
{
GstVideoFrame frame;
} FrameData;
static void
gst_schro_frame_free (SchroFrame * frame, void *priv)
{
FrameData *data = priv;
gst_video_frame_unmap (&data->frame);
g_slice_free (FrameData, data);
}
GstBuffer *
gst_schro_frame_get_buffer (SchroFrame * frame)
{
if (frame->priv)
return gst_buffer_ref (((FrameData *) frame->priv)->frame.buffer);
return NULL;
}
SchroFrame *
gst_schro_buffer_wrap (GstBuffer * buf, gboolean write, GstVideoInfo * vinfo)
{
SchroFrame *frame;
GstVideoFrame vframe;
FrameData *data;
gint i;
if (!gst_video_frame_map (&vframe, vinfo, buf,
(write ? GST_MAP_READWRITE : GST_MAP_READ)))
return NULL;
frame = schro_frame_new ();
frame->width = GST_VIDEO_FRAME_WIDTH (&vframe);
frame->height = GST_VIDEO_FRAME_HEIGHT (&vframe);
switch (GST_VIDEO_FRAME_FORMAT (&vframe)) {
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
frame->format = SCHRO_FRAME_FORMAT_U8_420;
break;
case GST_VIDEO_FORMAT_YUY2:
frame->format = SCHRO_FRAME_FORMAT_YUYV;
break;
case GST_VIDEO_FORMAT_UYVY:
frame->format = SCHRO_FRAME_FORMAT_UYVY;
break;
case GST_VIDEO_FORMAT_AYUV:
frame->format = SCHRO_FRAME_FORMAT_AYUV;
break;
#if SCHRO_CHECK_VERSION(1,0,12)
case GST_VIDEO_FORMAT_ARGB:
frame->format = SCHRO_FRAME_FORMAT_ARGB;
break;
#endif
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_Y42B:
frame->format = SCHRO_FRAME_FORMAT_U8_422;
break;
case GST_VIDEO_FORMAT_Y444:
frame->format = SCHRO_FRAME_FORMAT_U8_444;
break;
case GST_VIDEO_FORMAT_v210:
frame->format = SCHRO_FRAME_FORMAT_v210;
break;
case GST_VIDEO_FORMAT_v216:
frame->format = SCHRO_FRAME_FORMAT_v216;
break;
case GST_VIDEO_FORMAT_AYUV64:
frame->format = SCHRO_FRAME_FORMAT_AY64;
break;
#endif
default:
g_assert_not_reached ();
return NULL;
}
if (SCHRO_FRAME_IS_PACKED (frame->format)) {
frame->components[0].format = frame->format;
frame->components[0].width = frame->width;
frame->components[0].height = frame->height;
frame->components[0].stride = GST_VIDEO_FRAME_COMP_STRIDE (&vframe, 0);
frame->components[0].length = frame->components[0].stride * frame->height;
frame->components[0].data = vframe.data[0];
frame->components[0].v_shift = 0;
frame->components[0].h_shift = 0;
} else {
for (i = 0; i < GST_VIDEO_FRAME_N_COMPONENTS (&vframe); i++) {
frame->components[i].format = frame->format;
frame->components[i].width = GST_VIDEO_FRAME_COMP_WIDTH (&vframe, i);
frame->components[i].height = GST_VIDEO_FRAME_COMP_HEIGHT (&vframe, i);
frame->components[i].stride = GST_VIDEO_FRAME_COMP_STRIDE (&vframe, i);
frame->components[i].length =
frame->components[i].stride * frame->components[i].height;
frame->components[i].data = GST_VIDEO_FRAME_COMP_DATA (&vframe, i);
if (i == 0) {
frame->components[i].v_shift = 0;
frame->components[i].h_shift = 0;
} else {
frame->components[i].v_shift =
SCHRO_FRAME_FORMAT_H_SHIFT (frame->format);
frame->components[i].h_shift =
SCHRO_FRAME_FORMAT_H_SHIFT (frame->format);
}
}
}
data = g_slice_new0 (FrameData);
data->frame = vframe;
schro_frame_set_free_callback (frame, gst_schro_frame_free, data);
return frame;
}
static void
schro_buf_free_func (gpointer priv)
{
SchroBuffer *buffer = (SchroBuffer *) priv;
schro_buffer_unref (buffer);
}
/* takes the reference */
GstBuffer *
gst_schro_wrap_schro_buffer (SchroBuffer * buffer)
{
GstMemory *mem;
GstBuffer *buf;
mem =
gst_memory_new_wrapped (0, buffer->data, buffer->length, 0,
buffer->length, buffer, schro_buf_free_func);
buf = gst_buffer_new ();
gst_buffer_append_memory (buf, mem);
return buf;
}
typedef struct
{
GstMemory *mem;
GstMapInfo info;
} BufferData;
static void
gst_schro_buffer_free (SchroBuffer * buffer, void *priv)
{
BufferData *data = priv;
gst_memory_unmap (data->mem, &data->info);
gst_memory_unref (data->mem);
g_slice_free (BufferData, priv);
}
SchroBuffer *
gst_schro_wrap_gst_buffer (GstBuffer * buffer)
{
SchroBuffer *schrobuf;
GstMemory *mem;
GstMapInfo info;
BufferData *data;
mem = gst_buffer_get_all_memory (buffer);
if (!gst_memory_map (mem, &info, GST_MAP_READ)) {
GST_ERROR ("Couldn't get readable memory from gstbuffer");
return NULL;
}
/* FIXME : We can't control if data won't be read/write outside
* of schro ... */
data = g_slice_new0 (BufferData);
data->info = info;
data->mem = mem;
schrobuf = schro_buffer_new_with_data (info.data, info.size);
schrobuf->free = gst_schro_buffer_free;
schrobuf->priv = data;
return schrobuf;
}

View file

@ -1,45 +0,0 @@
/* Schrodinger
* Copyright (C) 2008 David Schleef <ds@schleef.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _GST_SCHRO_UTILS_H_
#define _GST_SCHRO_UTILS_H_
#include <gst/gst.h>
#include <gst/video/video.h>
#include <schroedinger/schro.h>
#if SCHRO_CHECK_VERSION(1,0,12)
#define GST_SCHRO_YUV_LIST "{ I420, YV12, YUY2, UYVY, AYUV, Y42B, Y444, v216, v210, AY64, ARGB }"
#else
#if SCHRO_CHECK_VERSION(1,0,11)
#define GST_SCHRO_YUV_LIST "{ I420, YV12, YUY2, UYVY, AYUV, Y42B, Y444, v216, v210, AY64 }"
#else
#define GST_SCHRO_YUV_LIST "{ I420, YV12, YUY2, UYVY, AYUV }"
#endif
#endif
SchroFrame *
gst_schro_buffer_wrap (GstBuffer *buf, gboolean write, GstVideoInfo * vinfo);
GstBuffer * gst_schro_frame_get_buffer (SchroFrame * frame);
GstBuffer * gst_schro_wrap_schro_buffer (SchroBuffer *buffer);
SchroBuffer * gst_schro_wrap_gst_buffer (GstBuffer *buffer);
#endif

View file

@ -1,20 +0,0 @@
schro_sources = [
'gstschro.c',
'gstschrodec.c',
'gstschroenc.c',
'gstschroutils.c',
]
schro_dep = dependency('schroedinger-1.0', version : '>= 1.0.10', required : false)
if schro_dep.found()
gstschro = library('gstschro',
schro_sources,
c_args : gst_plugins_bad_args,
link_args : noseh_link_args,
include_directories : [configinc],
dependencies : [gstvideo_dep, schro_dep],
install : true,
install_dir : plugins_install_dir,
)
endif

View file

@ -213,7 +213,6 @@ check_functions = [
# check token HAVE_RSVG_2_36_2
# check token HAVE_RTMP
# check token HAVE_SBC
# check token HAVE_SCHRO
# check token HAVE_SDL
# check token HAVE_SHM
# check token HAVE_SMOOTHSTREAMING

View file

@ -108,12 +108,6 @@ else
check_ofa =
endif
if USE_SCHRO
check_schro=elements/schroenc
else
check_schro=
endif
if USE_X265
check_x265enc=elements/x265enc
else
@ -285,7 +279,6 @@ check_PROGRAMS = \
libs/vp8parser \
$(check_uvch264) \
libs/vc1parser \
$(check_schro) \
$(check_x265enc) \
elements/viewfinderbin \
$(check_zbar) \

View file

@ -52,7 +52,6 @@ rglimiter
rgvolume
rtponvifparse
rtponviftimestamp
schroenc
shm
spectrum
srtp

View file

@ -1,177 +0,0 @@
/* GStreamer
*
* Copyright (c) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* Copyright (c) 2010 David Schleef <ds@schleef.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <gst/check/gstcheck.h>
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-dirac, "
"width = (int) [1, MAX], "
"height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]"));
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-raw, "
"format = (string) I420, "
"width = (int) [1, MAX], "
"height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]"));
static GstPad *sinkpad, *srcpad;
static GstElement *
setup_schroenc (const gchar * src_caps_str)
{
GstElement *schroenc;
GstCaps *srccaps = NULL;
GstBus *bus;
if (src_caps_str) {
srccaps = gst_caps_from_string (src_caps_str);
fail_unless (srccaps != NULL);
}
schroenc = gst_check_setup_element ("schroenc");
fail_unless (schroenc != NULL);
srcpad = gst_check_setup_src_pad (schroenc, &srctemplate);
sinkpad = gst_check_setup_sink_pad (schroenc, &sinktemplate);
gst_pad_set_active (srcpad, TRUE);
gst_pad_set_active (sinkpad, TRUE);
gst_check_setup_events (srcpad, schroenc, srccaps, GST_FORMAT_TIME);
bus = gst_bus_new ();
gst_element_set_bus (schroenc, bus);
fail_unless (gst_element_set_state (schroenc,
GST_STATE_PLAYING) != GST_STATE_CHANGE_FAILURE,
"could not set to playing");
if (srccaps)
gst_caps_unref (srccaps);
buffers = NULL;
return schroenc;
}
static void
cleanup_schroenc (GstElement * schroenc)
{
GstBus *bus;
/* Free parsed buffers */
gst_check_drop_buffers ();
bus = GST_ELEMENT_BUS (schroenc);
gst_bus_set_flushing (bus, TRUE);
gst_object_unref (bus);
gst_pad_set_active (srcpad, FALSE);
gst_pad_set_active (sinkpad, FALSE);
gst_check_teardown_src_pad (schroenc);
gst_check_teardown_sink_pad (schroenc);
gst_check_teardown_element (schroenc);
}
GST_START_TEST (test_encode_simple)
{
GstElement *schroenc;
GstBuffer *buffer;
gint i;
GList *l;
GstCaps *outcaps, *sinkcaps;
GstSegment seg;
schroenc =
setup_schroenc
("video/x-raw,format=(string)I420,width=(int)320,height=(int)240,framerate=(fraction)25/1");
g_object_set (schroenc, "queue-depth", 10, NULL);
gst_segment_init (&seg, GST_FORMAT_TIME);
seg.stop = gst_util_uint64_scale (20, GST_SECOND, 25);
fail_unless (gst_pad_push_event (srcpad, gst_event_new_segment (&seg)));
buffer = gst_buffer_new_allocate (NULL, 320 * 240 + 2 * 160 * 120, NULL);
gst_buffer_memset (buffer, 0, 0, -1);
for (i = 0; i < 20; i++) {
GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (i, GST_SECOND, 25);
GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale (1, GST_SECOND, 25);
fail_unless (gst_pad_push (srcpad, gst_buffer_ref (buffer)) == GST_FLOW_OK);
}
gst_buffer_unref (buffer);
/* Only 5 buffers are allowed to be queued now */
fail_unless (g_list_length (buffers) > 10);
fail_unless (gst_pad_push_event (srcpad, gst_event_new_eos ()));
/* All buffers must be there now */
fail_unless_equals_int (g_list_length (buffers), 20);
outcaps =
gst_caps_from_string
("video/x-dirac,width=(int)320,height=(int)240,framerate=(fraction)25/1");
for (l = buffers, i = 0; l; l = l->next, i++) {
buffer = l->data;
if (i == 0)
fail_if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT));
#if 0
fail_unless_equals_uint64 (GST_BUFFER_TIMESTAMP (buffer),
gst_util_uint64_scale (i, GST_SECOND, 25));
#endif
fail_unless_equals_uint64 (GST_BUFFER_DURATION (buffer),
gst_util_uint64_scale (1, GST_SECOND, 25));
sinkcaps = gst_pad_get_current_caps (sinkpad);
fail_unless (gst_caps_can_intersect (sinkcaps, outcaps));
gst_caps_unref (sinkcaps);
}
gst_caps_unref (outcaps);
cleanup_schroenc (schroenc);
}
GST_END_TEST;
static Suite *
schroenc_suite (void)
{
Suite *s = suite_create ("schroenc");
TCase *tc_chain = tcase_create ("general");
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_encode_simple);
return s;
}
GST_CHECK_MAIN (schroenc);

View file

@ -47,7 +47,6 @@ base_tests = [
[['elements/netsim.c']],
[['elements/pcapparse.c'], false, [libparser_dep]],
[['elements/pnm.c']],
[['elements/schroenc.c'], not schro_dep.found(), [schro_dep]],
[['elements/shm.c'], not shm_enabled, shm_deps],
[['elements/rtponvifparse.c']],
[['elements/rtponviftimestamp.c']],