Merge pull request #40 from sdroege/negotiate

Don't do anything in BaseSrc::negotiate()
This commit is contained in:
Ruben Gonzalez 2019-08-06 23:17:03 +02:00 committed by GitHub
commit 842603482b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 10 deletions

View file

@ -375,7 +375,13 @@ impl ElementImpl for NdiAudioSrc {
}
impl BaseSrcImpl for NdiAudioSrc {
fn unlock(&self, element: &gst_base::BaseSrc) -> std::result::Result<(), gst::ErrorMessage> {
fn negotiate(&self, _element: &gst_base::BaseSrc) -> Result<(), gst::LoggableError> {
// Always succeed here without doing anything: we will set the caps once we received a
// buffer, there's nothing we can negotiate
Ok(())
}
fn unlock(&self, element: &gst_base::BaseSrc) -> Result<(), gst::ErrorMessage> {
gst_debug!(self.cat, obj: element, "Unlocking",);
if let Some(ref controller) = *self.receiver_controller.lock().unwrap() {
controller.set_flushing(true);
@ -383,10 +389,7 @@ impl BaseSrcImpl for NdiAudioSrc {
Ok(())
}
fn unlock_stop(
&self,
element: &gst_base::BaseSrc,
) -> std::result::Result<(), gst::ErrorMessage> {
fn unlock_stop(&self, element: &gst_base::BaseSrc) -> Result<(), gst::ErrorMessage> {
gst_debug!(self.cat, obj: element, "Stop unlocking",);
if let Some(ref controller) = *self.receiver_controller.lock().unwrap() {
controller.set_flushing(false);

View file

@ -410,7 +410,13 @@ impl ElementImpl for NdiVideoSrc {
}
impl BaseSrcImpl for NdiVideoSrc {
fn unlock(&self, element: &gst_base::BaseSrc) -> std::result::Result<(), gst::ErrorMessage> {
fn negotiate(&self, _element: &gst_base::BaseSrc) -> Result<(), gst::LoggableError> {
// Always succeed here without doing anything: we will set the caps once we received a
// buffer, there's nothing we can negotiate
Ok(())
}
fn unlock(&self, element: &gst_base::BaseSrc) -> Result<(), gst::ErrorMessage> {
gst_debug!(self.cat, obj: element, "Unlocking",);
if let Some(ref controller) = *self.receiver_controller.lock().unwrap() {
controller.set_flushing(true);
@ -418,10 +424,7 @@ impl BaseSrcImpl for NdiVideoSrc {
Ok(())
}
fn unlock_stop(
&self,
element: &gst_base::BaseSrc,
) -> std::result::Result<(), gst::ErrorMessage> {
fn unlock_stop(&self, element: &gst_base::BaseSrc) -> Result<(), gst::ErrorMessage> {
gst_debug!(self.cat, obj: element, "Stop unlocking",);
if let Some(ref controller) = *self.receiver_controller.lock().unwrap() {
controller.set_flushing(false);