• Home
  • Raw
  • Download

Lines Matching refs:enc

226 static gboolean gst_opus_enc_setup (GstOpusEnc * enc);
233 static void gst_opus_enc_set_tags (GstOpusEnc * enc);
240 static gint64 gst_opus_enc_get_latency (GstOpusEnc * enc);
242 static GstFlowReturn gst_opus_enc_encode (GstOpusEnc * enc, GstBuffer * buffer);
252 gst_opus_enc_set_tags (GstOpusEnc * enc) in gst_opus_enc_set_tags() argument
259 GST_TAG_BITRATE, enc->bitrate, NULL); in gst_opus_enc_set_tags()
261 gst_audio_encoder_merge_tags (GST_AUDIO_ENCODER (enc), taglist, in gst_opus_enc_set_tags()
361 GstOpusEnc *enc; in gst_opus_enc_finalize() local
363 enc = GST_OPUS_ENC (object); in gst_opus_enc_finalize()
365 g_mutex_clear (&enc->property_lock); in gst_opus_enc_finalize()
371 gst_opus_enc_init (GstOpusEnc * enc) in gst_opus_enc_init() argument
373 GST_DEBUG_OBJECT (enc, "init"); in gst_opus_enc_init()
375 GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (enc)); in gst_opus_enc_init()
377 g_mutex_init (&enc->property_lock); in gst_opus_enc_init()
379 enc->n_channels = -1; in gst_opus_enc_init()
380 enc->sample_rate = -1; in gst_opus_enc_init()
381 enc->frame_samples = 0; in gst_opus_enc_init()
382 enc->unpositioned = FALSE; in gst_opus_enc_init()
384 enc->bitrate = DEFAULT_BITRATE; in gst_opus_enc_init()
385 enc->bandwidth = DEFAULT_BANDWIDTH; in gst_opus_enc_init()
386 enc->frame_size = DEFAULT_FRAMESIZE; in gst_opus_enc_init()
387 enc->bitrate_type = DEFAULT_BITRATE_TYPE; in gst_opus_enc_init()
388 enc->complexity = DEFAULT_COMPLEXITY; in gst_opus_enc_init()
389 enc->inband_fec = DEFAULT_INBAND_FEC; in gst_opus_enc_init()
390 enc->dtx = DEFAULT_DTX; in gst_opus_enc_init()
391 enc->packet_loss_percentage = DEFAULT_PACKET_LOSS_PERCENT; in gst_opus_enc_init()
392 enc->max_payload_size = DEFAULT_MAX_PAYLOAD_SIZE; in gst_opus_enc_init()
393 enc->audio_type = DEFAULT_AUDIO_TYPE; in gst_opus_enc_init()
399 GstOpusEnc *enc = GST_OPUS_ENC (benc); in gst_opus_enc_start() local
401 GST_DEBUG_OBJECT (enc, "start"); in gst_opus_enc_start()
402 enc->encoded_samples = 0; in gst_opus_enc_start()
403 enc->consumed_samples = 0; in gst_opus_enc_start()
411 GstOpusEnc *enc = GST_OPUS_ENC (benc); in gst_opus_enc_stop() local
413 GST_DEBUG_OBJECT (enc, "stop"); in gst_opus_enc_stop()
414 if (enc->state) { in gst_opus_enc_stop()
415 opus_multistream_encoder_destroy (enc->state); in gst_opus_enc_stop()
416 enc->state = NULL; in gst_opus_enc_stop()
418 gst_tag_setter_reset_tags (GST_TAG_SETTER (enc)); in gst_opus_enc_stop()
424 gst_opus_enc_get_latency (GstOpusEnc * enc) in gst_opus_enc_get_latency() argument
426 gint64 latency = gst_util_uint64_scale (enc->frame_samples, GST_SECOND, in gst_opus_enc_get_latency()
427 enc->sample_rate); in gst_opus_enc_get_latency()
428 GST_DEBUG_OBJECT (enc, "Latency: %" GST_TIME_FORMAT, GST_TIME_ARGS (latency)); in gst_opus_enc_get_latency()
433 gst_opus_enc_setup_base_class (GstOpusEnc * enc, GstAudioEncoder * benc) in gst_opus_enc_setup_base_class() argument
436 gst_opus_enc_get_latency (enc), gst_opus_enc_get_latency (enc)); in gst_opus_enc_setup_base_class()
437 gst_audio_encoder_set_frame_samples_min (benc, enc->frame_samples); in gst_opus_enc_setup_base_class()
438 gst_audio_encoder_set_frame_samples_max (benc, enc->frame_samples); in gst_opus_enc_setup_base_class()
443 gst_opus_enc_get_frame_samples (GstOpusEnc * enc) in gst_opus_enc_get_frame_samples() argument
446 switch (enc->frame_size) { in gst_opus_enc_get_frame_samples()
448 frame_samples = enc->sample_rate / 400; in gst_opus_enc_get_frame_samples()
451 frame_samples = enc->sample_rate / 200; in gst_opus_enc_get_frame_samples()
454 frame_samples = enc->sample_rate / 100; in gst_opus_enc_get_frame_samples()
457 frame_samples = enc->sample_rate / 50; in gst_opus_enc_get_frame_samples()
460 frame_samples = enc->sample_rate / 25; in gst_opus_enc_get_frame_samples()
463 frame_samples = 3 * enc->sample_rate / 50; in gst_opus_enc_get_frame_samples()
466 GST_WARNING_OBJECT (enc, "Unsupported frame size: %d", enc->frame_size); in gst_opus_enc_get_frame_samples()
474 gst_opus_enc_setup_trivial_mapping (GstOpusEnc * enc, guint8 mapping[256]) in gst_opus_enc_setup_trivial_mapping() argument
483 gst_opus_enc_find_channel_position (GstOpusEnc * enc, const GstAudioInfo * info, in gst_opus_enc_find_channel_position() argument
487 for (n = 0; n < enc->n_channels; ++n) { in gst_opus_enc_find_channel_position()
496 gst_opus_enc_find_channel_position_in_vorbis_order (GstOpusEnc * enc, in gst_opus_enc_find_channel_position_in_vorbis_order() argument
501 for (c = 0; c < enc->n_channels; ++c) { in gst_opus_enc_find_channel_position_in_vorbis_order()
502 if (gst_opus_channel_positions[enc->n_channels - 1][c] == position) { in gst_opus_enc_find_channel_position_in_vorbis_order()
503 GST_INFO_OBJECT (enc, in gst_opus_enc_find_channel_position_in_vorbis_order()
509 GST_WARNING_OBJECT (enc, in gst_opus_enc_find_channel_position_in_vorbis_order()
516 gst_opus_enc_setup_channel_mappings (GstOpusEnc * enc, in gst_opus_enc_setup_channel_mappings() argument
523 GST_DEBUG_OBJECT (enc, "Setting up channel mapping for %d channels", in gst_opus_enc_setup_channel_mappings()
524 enc->n_channels); in gst_opus_enc_setup_channel_mappings()
527 enc->n_stereo_streams = 0; in gst_opus_enc_setup_channel_mappings()
528 gst_opus_enc_setup_trivial_mapping (enc, enc->encoding_channel_mapping); in gst_opus_enc_setup_channel_mappings()
529 gst_opus_enc_setup_trivial_mapping (enc, enc->decoding_channel_mapping); in gst_opus_enc_setup_channel_mappings()
532 if (enc->n_channels == 1 && !enc->unpositioned) { in gst_opus_enc_setup_channel_mappings()
533 GST_INFO_OBJECT (enc, "Mono, trivial RTP mapping"); in gst_opus_enc_setup_channel_mappings()
534 enc->channel_mapping_family = 0; in gst_opus_enc_setup_channel_mappings()
541 if (enc->n_channels == 2 && !enc->unpositioned) { in gst_opus_enc_setup_channel_mappings()
542 GST_INFO_OBJECT (enc, "Stereo, trivial RTP mapping"); in gst_opus_enc_setup_channel_mappings()
543 enc->channel_mapping_family = 0; in gst_opus_enc_setup_channel_mappings()
544 enc->n_stereo_streams = 1; in gst_opus_enc_setup_channel_mappings()
555 if (enc->n_channels >= 3 && enc->n_channels <= 8 && !enc->unpositioned) { in gst_opus_enc_setup_channel_mappings()
575 GST_DEBUG_OBJECT (enc, in gst_opus_enc_setup_channel_mappings()
578 enc->n_stereo_streams = 0; in gst_opus_enc_setup_channel_mappings()
587 c0 = gst_opus_enc_find_channel_position (enc, info, p0); in gst_opus_enc_setup_channel_mappings()
588 c1 = gst_opus_enc_find_channel_position (enc, info, p1); in gst_opus_enc_setup_channel_mappings()
591 GST_DEBUG_OBJECT (enc, "Natural pair '%s/%s' found at %d %d", in gst_opus_enc_setup_channel_mappings()
594 c0v = gst_opus_enc_find_channel_position_in_vorbis_order (enc, p0); in gst_opus_enc_setup_channel_mappings()
595 c1v = gst_opus_enc_find_channel_position_in_vorbis_order (enc, p1); in gst_opus_enc_setup_channel_mappings()
597 GST_WARNING_OBJECT (enc, in gst_opus_enc_setup_channel_mappings()
599 enc->channel_mapping_family = 255; in gst_opus_enc_setup_channel_mappings()
600 enc->n_stereo_streams = 0; in gst_opus_enc_setup_channel_mappings()
604 enc->encoding_channel_mapping[mapped] = c0; in gst_opus_enc_setup_channel_mappings()
605 enc->encoding_channel_mapping[mapped + 1] = c1; in gst_opus_enc_setup_channel_mappings()
606 enc->decoding_channel_mapping[c0v] = mapped; in gst_opus_enc_setup_channel_mappings()
607 enc->decoding_channel_mapping[c1v] = mapped + 1; in gst_opus_enc_setup_channel_mappings()
608 enc->n_stereo_streams++; in gst_opus_enc_setup_channel_mappings()
615 for (n = 0; n < enc->n_channels; ++n) { in gst_opus_enc_setup_channel_mappings()
622 GST_DEBUG_OBJECT (enc, "Channel position %s is not mapped yet, adding", in gst_opus_enc_setup_channel_mappings()
624 cv = gst_opus_enc_find_channel_position_in_vorbis_order (enc, position); in gst_opus_enc_setup_channel_mappings()
627 enc->encoding_channel_mapping[mapped] = n; in gst_opus_enc_setup_channel_mappings()
628 enc->decoding_channel_mapping[cv] = mapped; in gst_opus_enc_setup_channel_mappings()
634 GST_INFO_OBJECT (enc, in gst_opus_enc_setup_channel_mappings()
635 "Mapping tables built: %d channels, %d stereo streams", enc->n_channels, in gst_opus_enc_setup_channel_mappings()
636 enc->n_stereo_streams); in gst_opus_enc_setup_channel_mappings()
637 gst_opus_common_log_channel_mapping_table (GST_ELEMENT (enc), opusenc_debug, in gst_opus_enc_setup_channel_mappings()
638 "Encoding mapping table", enc->n_channels, in gst_opus_enc_setup_channel_mappings()
639 enc->encoding_channel_mapping); in gst_opus_enc_setup_channel_mappings()
640 gst_opus_common_log_channel_mapping_table (GST_ELEMENT (enc), opusenc_debug, in gst_opus_enc_setup_channel_mappings()
641 "Decoding mapping table", enc->n_channels, in gst_opus_enc_setup_channel_mappings()
642 enc->decoding_channel_mapping); in gst_opus_enc_setup_channel_mappings()
645 enc->channel_mapping_family = 1; in gst_opus_enc_setup_channel_mappings()
653 if (!enc->unpositioned) in gst_opus_enc_setup_channel_mappings()
654 GST_WARNING_OBJECT (enc, "Unknown mapping"); in gst_opus_enc_setup_channel_mappings()
656 GST_INFO_OBJECT (enc, "Unpositioned mapping, all channels mono"); in gst_opus_enc_setup_channel_mappings()
658 enc->channel_mapping_family = 255; in gst_opus_enc_setup_channel_mappings()
659 enc->n_stereo_streams = 0; in gst_opus_enc_setup_channel_mappings()
667 GstOpusEnc *enc; in gst_opus_enc_set_format() local
669 enc = GST_OPUS_ENC (benc); in gst_opus_enc_set_format()
671 g_mutex_lock (&enc->property_lock); in gst_opus_enc_set_format()
673 enc->n_channels = GST_AUDIO_INFO_CHANNELS (info); in gst_opus_enc_set_format()
674 enc->unpositioned = GST_AUDIO_INFO_IS_UNPOSITIONED (info); in gst_opus_enc_set_format()
675 enc->sample_rate = GST_AUDIO_INFO_RATE (info); in gst_opus_enc_set_format()
676 gst_opus_enc_setup_channel_mappings (enc, info); in gst_opus_enc_set_format()
677 GST_DEBUG_OBJECT (benc, "Setup with %d channels, %d Hz", enc->n_channels, in gst_opus_enc_set_format()
678 enc->sample_rate); in gst_opus_enc_set_format()
681 if (enc->state) { in gst_opus_enc_set_format()
682 opus_multistream_encoder_destroy (enc->state); in gst_opus_enc_set_format()
683 enc->state = NULL; in gst_opus_enc_set_format()
685 if (!gst_opus_enc_setup (enc)) { in gst_opus_enc_set_format()
686 g_mutex_unlock (&enc->property_lock); in gst_opus_enc_set_format()
691 gst_opus_enc_set_tags (enc); in gst_opus_enc_set_format()
693 enc->frame_samples = gst_opus_enc_get_frame_samples (enc); in gst_opus_enc_set_format()
696 gst_opus_enc_setup_base_class (enc, benc); in gst_opus_enc_set_format()
698 g_mutex_unlock (&enc->property_lock); in gst_opus_enc_set_format()
704 gst_opus_enc_setup (GstOpusEnc * enc) in gst_opus_enc_setup() argument
715 GST_DEBUG_OBJECT (enc, in gst_opus_enc_setup()
717 enc->sample_rate, enc->n_channels, enc->n_stereo_streams, in gst_opus_enc_setup()
718 enc->channel_mapping_family); in gst_opus_enc_setup()
719 GST_INFO_OBJECT (enc, "Mapping tables built: %d channels, %d stereo streams", in gst_opus_enc_setup()
720 enc->n_channels, enc->n_stereo_streams); in gst_opus_enc_setup()
721 gst_opus_common_log_channel_mapping_table (GST_ELEMENT (enc), opusenc_debug, in gst_opus_enc_setup()
722 "Encoding mapping table", enc->n_channels, enc->encoding_channel_mapping); in gst_opus_enc_setup()
723 gst_opus_common_log_channel_mapping_table (GST_ELEMENT (enc), opusenc_debug, in gst_opus_enc_setup()
724 "Decoding mapping table", enc->n_channels, enc->decoding_channel_mapping); in gst_opus_enc_setup()
727 enc->state = opus_multistream_encoder_create (enc->sample_rate, in gst_opus_enc_setup()
728 enc->n_channels, enc->n_channels - enc->n_stereo_streams, in gst_opus_enc_setup()
729 enc->n_stereo_streams, enc->encoding_channel_mapping, in gst_opus_enc_setup()
730 enc->audio_type, &error); in gst_opus_enc_setup()
731 if (!enc->state || error != OPUS_OK) in gst_opus_enc_setup()
734 opus_multistream_encoder_ctl (enc->state, OPUS_SET_BITRATE (enc->bitrate), 0); in gst_opus_enc_setup()
735 opus_multistream_encoder_ctl (enc->state, OPUS_SET_BANDWIDTH (enc->bandwidth), in gst_opus_enc_setup()
737 opus_multistream_encoder_ctl (enc->state, in gst_opus_enc_setup()
738 OPUS_SET_VBR (enc->bitrate_type != BITRATE_TYPE_CBR), 0); in gst_opus_enc_setup()
739 opus_multistream_encoder_ctl (enc->state, in gst_opus_enc_setup()
740 OPUS_SET_VBR_CONSTRAINT (enc->bitrate_type == in gst_opus_enc_setup()
742 opus_multistream_encoder_ctl (enc->state, in gst_opus_enc_setup()
743 OPUS_SET_COMPLEXITY (enc->complexity), 0); in gst_opus_enc_setup()
744 opus_multistream_encoder_ctl (enc->state, in gst_opus_enc_setup()
745 OPUS_SET_INBAND_FEC (enc->inband_fec), 0); in gst_opus_enc_setup()
746 opus_multistream_encoder_ctl (enc->state, OPUS_SET_DTX (enc->dtx), 0); in gst_opus_enc_setup()
747 opus_multistream_encoder_ctl (enc->state, in gst_opus_enc_setup()
748 OPUS_SET_PACKET_LOSS_PERC (enc->packet_loss_percentage), 0); in gst_opus_enc_setup()
750 opus_multistream_encoder_ctl (enc->state, OPUS_GET_LOOKAHEAD (&lookahead), 0); in gst_opus_enc_setup()
752 GST_LOG_OBJECT (enc, "we have frame size %d, lookahead %d", enc->frame_size, in gst_opus_enc_setup()
756 lookahead = lookahead * 48000 / enc->sample_rate; in gst_opus_enc_setup()
757 enc->lookahead = enc->pending_lookahead = lookahead; in gst_opus_enc_setup()
759 header = gst_codec_utils_opus_create_header (enc->sample_rate, in gst_opus_enc_setup()
760 enc->n_channels, enc->channel_mapping_family, in gst_opus_enc_setup()
761 enc->n_channels - enc->n_stereo_streams, enc->n_stereo_streams, in gst_opus_enc_setup()
762 enc->decoding_channel_mapping, lookahead, 0); in gst_opus_enc_setup()
763 tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (enc)); in gst_opus_enc_setup()
776 GST_DEBUG_OBJECT (enc, "here are the caps: %" GST_PTR_FORMAT, caps); in gst_opus_enc_setup()
778 ret = gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (enc), caps); in gst_opus_enc_setup()
784 GST_ERROR_OBJECT (enc, "Encoder creation failed"); in gst_opus_enc_setup()
791 GstOpusEnc *enc; in gst_opus_enc_sink_event() local
793 enc = GST_OPUS_ENC (benc); in gst_opus_enc_sink_event()
795 GST_DEBUG_OBJECT (enc, "sink event: %s", GST_EVENT_TYPE_NAME (event)); in gst_opus_enc_sink_event()
800 GstTagSetter *setter = GST_TAG_SETTER (enc); in gst_opus_enc_sink_event()
808 enc->encoded_samples = 0; in gst_opus_enc_sink_event()
809 enc->consumed_samples = 0; in gst_opus_enc_sink_event()
912 GstOpusEnc *enc; in gst_opus_enc_sink_getcaps() local
915 enc = GST_OPUS_ENC (benc); in gst_opus_enc_sink_getcaps()
917 GST_DEBUG_OBJECT (enc, "sink getcaps"); in gst_opus_enc_sink_getcaps()
922 GST_DEBUG_OBJECT (enc, "Returning caps: %" GST_PTR_FORMAT, caps); in gst_opus_enc_sink_getcaps()
928 gst_opus_enc_encode (GstOpusEnc * enc, GstBuffer * buf) in gst_opus_enc_encode() argument
943 g_mutex_lock (&enc->property_lock); in gst_opus_enc_encode()
945 bytes = enc->frame_samples * enc->n_channels * 2; in gst_opus_enc_encode()
946 max_payload_size = enc->max_payload_size; in gst_opus_enc_encode()
947 frame_samples = input_samples = enc->frame_samples; in gst_opus_enc_encode()
949 g_mutex_unlock (&enc->property_lock); in gst_opus_enc_encode()
959 GST_DEBUG_OBJECT (enc, "draining; adding silence samples"); in gst_opus_enc_encode()
962 input_samples = bsize / (enc->n_channels * 2); in gst_opus_enc_encode()
964 (enc->encoded_samples + frame_samples) - (enc->consumed_samples + in gst_opus_enc_encode()
967 GST_DEBUG_OBJECT (enc, in gst_opus_enc_encode()
971 trim_end = diff * 48000 / enc->sample_rate; in gst_opus_enc_encode()
973 GST_DEBUG_OBJECT (enc, in gst_opus_enc_encode()
992 if (enc->pending_lookahead) { in gst_opus_enc_encode()
994 enc->pending_lookahead * enc->sample_rate / 48000; in gst_opus_enc_encode()
998 trim_start = enc->pending_lookahead; in gst_opus_enc_encode()
999 enc->pending_lookahead = 0; in gst_opus_enc_encode()
1001 trim_start = ((guint64) input_samples) * 48000 / enc->sample_rate; in gst_opus_enc_encode()
1002 enc->pending_lookahead -= trim_start; in gst_opus_enc_encode()
1010 if (enc->encoded_samples < enc->consumed_samples) { in gst_opus_enc_encode()
1017 output_samples = enc->consumed_samples - enc->encoded_samples; in gst_opus_enc_encode()
1019 GST_DEBUG_OBJECT (enc, "draining %d samples", output_samples); in gst_opus_enc_encode()
1021 ((guint64) frame_samples - output_samples) * 48000 / enc->sample_rate; in gst_opus_enc_encode()
1022 } else if (enc->encoded_samples == enc->consumed_samples) { in gst_opus_enc_encode()
1023 GST_DEBUG_OBJECT (enc, "nothing to drain"); in gst_opus_enc_encode()
1034 gst_audio_encoder_allocate_output_buffer (GST_AUDIO_ENCODER (enc), in gst_opus_enc_encode()
1035 max_payload_size * enc->n_channels); in gst_opus_enc_encode()
1039 GST_DEBUG_OBJECT (enc, "encoding %d samples (%d bytes)", in gst_opus_enc_encode()
1043 GST_DEBUG_OBJECT (enc, in gst_opus_enc_encode()
1053 opus_multistream_encode (enc->state, (const gint16 *) data, in gst_opus_enc_encode()
1054 frame_samples, omap.data, max_payload_size * enc->n_channels); in gst_opus_enc_encode()
1059 GST_ELEMENT_ERROR (enc, STREAM, ENCODE, (NULL), in gst_opus_enc_encode()
1064 GST_ELEMENT_ERROR (enc, STREAM, ENCODE, (NULL), in gst_opus_enc_encode()
1071 GST_DEBUG_OBJECT (enc, "Output packet is %u bytes", outsize); in gst_opus_enc_encode()
1076 gst_audio_encoder_finish_frame (GST_AUDIO_ENCODER (enc), outbuf, in gst_opus_enc_encode()
1078 enc->encoded_samples += output_samples; in gst_opus_enc_encode()
1079 enc->consumed_samples += input_samples; in gst_opus_enc_encode()
1094 GstOpusEnc *enc; in gst_opus_enc_handle_frame() local
1097 enc = GST_OPUS_ENC (benc); in gst_opus_enc_handle_frame()
1098 GST_DEBUG_OBJECT (enc, "handle_frame"); in gst_opus_enc_handle_frame()
1099 GST_DEBUG_OBJECT (enc, "received buffer %p of %" G_GSIZE_FORMAT " bytes", buf, in gst_opus_enc_handle_frame()
1102 ret = gst_opus_enc_encode (enc, buf); in gst_opus_enc_handle_frame()
1111 GstOpusEnc *enc; in gst_opus_enc_get_property() local
1113 enc = GST_OPUS_ENC (object); in gst_opus_enc_get_property()
1115 g_mutex_lock (&enc->property_lock); in gst_opus_enc_get_property()
1119 g_value_set_enum (value, enc->audio_type); in gst_opus_enc_get_property()
1122 g_value_set_int (value, enc->bitrate); in gst_opus_enc_get_property()
1125 g_value_set_enum (value, enc->bandwidth); in gst_opus_enc_get_property()
1128 g_value_set_enum (value, enc->frame_size); in gst_opus_enc_get_property()
1131 g_value_set_enum (value, enc->bitrate_type); in gst_opus_enc_get_property()
1134 g_value_set_int (value, enc->complexity); in gst_opus_enc_get_property()
1137 g_value_set_boolean (value, enc->inband_fec); in gst_opus_enc_get_property()
1140 g_value_set_boolean (value, enc->dtx); in gst_opus_enc_get_property()
1143 g_value_set_int (value, enc->packet_loss_percentage); in gst_opus_enc_get_property()
1146 g_value_set_uint (value, enc->max_payload_size); in gst_opus_enc_get_property()
1153 g_mutex_unlock (&enc->property_lock); in gst_opus_enc_get_property()
1160 GstOpusEnc *enc; in gst_opus_enc_set_property() local
1162 enc = GST_OPUS_ENC (object); in gst_opus_enc_set_property()
1165 g_mutex_lock (&enc->property_lock); \ in gst_opus_enc_set_property()
1166 enc->prop = g_value_get_##type (value); \ in gst_opus_enc_set_property()
1167 if (enc->state) { \ in gst_opus_enc_set_property()
1168 opus_multistream_encoder_ctl (enc->state, OPUS_SET_##ctl (enc->prop)); \ in gst_opus_enc_set_property()
1170 g_mutex_unlock (&enc->property_lock); \ in gst_opus_enc_set_property()
1175 enc->audio_type = g_value_get_enum (value); in gst_opus_enc_set_property()
1184 g_mutex_lock (&enc->property_lock); in gst_opus_enc_set_property()
1185 enc->frame_size = g_value_get_enum (value); in gst_opus_enc_set_property()
1186 enc->frame_samples = gst_opus_enc_get_frame_samples (enc); in gst_opus_enc_set_property()
1187 gst_opus_enc_setup_base_class (enc, GST_AUDIO_ENCODER (enc)); in gst_opus_enc_set_property()
1188 g_mutex_unlock (&enc->property_lock); in gst_opus_enc_set_property()
1192 g_mutex_lock (&enc->property_lock); in gst_opus_enc_set_property()
1193 enc->bitrate_type = g_value_get_enum (value); in gst_opus_enc_set_property()
1194 if (enc->state) { in gst_opus_enc_set_property()
1195 opus_multistream_encoder_ctl (enc->state, in gst_opus_enc_set_property()
1196 OPUS_SET_VBR (enc->bitrate_type != BITRATE_TYPE_CBR)); in gst_opus_enc_set_property()
1197 opus_multistream_encoder_ctl (enc->state, in gst_opus_enc_set_property()
1198 OPUS_SET_VBR_CONSTRAINT (enc->bitrate_type == in gst_opus_enc_set_property()
1201 g_mutex_unlock (&enc->property_lock); in gst_opus_enc_set_property()
1216 g_mutex_lock (&enc->property_lock); in gst_opus_enc_set_property()
1217 enc->max_payload_size = g_value_get_uint (value); in gst_opus_enc_set_property()
1218 g_mutex_unlock (&enc->property_lock); in gst_opus_enc_set_property()