mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-08 16:25:26 +00:00
base: decide_query in Aggregator/BaseTransform propose_allocation() is nullable
This commit is contained in:
parent
f6cf6c8863
commit
dc7e705f44
2 changed files with 28 additions and 14 deletions
|
@ -153,7 +153,7 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl {
|
||||||
&self,
|
&self,
|
||||||
element: &Self::Type,
|
element: &Self::Type,
|
||||||
pad: &AggregatorPad,
|
pad: &AggregatorPad,
|
||||||
decide_query: gst::query::Allocation<&gst::QueryRef>,
|
decide_query: Option<gst::query::Allocation<&gst::QueryRef>>,
|
||||||
query: gst::query::Allocation<&mut gst::QueryRef>,
|
query: gst::query::Allocation<&mut gst::QueryRef>,
|
||||||
) -> Result<(), gst::ErrorMessage> {
|
) -> Result<(), gst::ErrorMessage> {
|
||||||
self.parent_propose_allocation(element, pad, decide_query, query)
|
self.parent_propose_allocation(element, pad, decide_query, query)
|
||||||
|
@ -289,7 +289,7 @@ pub trait AggregatorImplExt: ObjectSubclass {
|
||||||
&self,
|
&self,
|
||||||
element: &Self::Type,
|
element: &Self::Type,
|
||||||
pad: &AggregatorPad,
|
pad: &AggregatorPad,
|
||||||
decide_query: gst::query::Allocation<&gst::QueryRef>,
|
decide_query: Option<gst::query::Allocation<&gst::QueryRef>>,
|
||||||
query: gst::query::Allocation<&mut gst::QueryRef>,
|
query: gst::query::Allocation<&mut gst::QueryRef>,
|
||||||
) -> Result<(), gst::ErrorMessage>;
|
) -> Result<(), gst::ErrorMessage>;
|
||||||
|
|
||||||
|
@ -692,7 +692,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
&self,
|
&self,
|
||||||
element: &Self::Type,
|
element: &Self::Type,
|
||||||
pad: &AggregatorPad,
|
pad: &AggregatorPad,
|
||||||
decide_query: gst::query::Allocation<&gst::QueryRef>,
|
decide_query: Option<gst::query::Allocation<&gst::QueryRef>>,
|
||||||
query: gst::query::Allocation<&mut gst::QueryRef>,
|
query: gst::query::Allocation<&mut gst::QueryRef>,
|
||||||
) -> Result<(), gst::ErrorMessage> {
|
) -> Result<(), gst::ErrorMessage> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -704,7 +704,10 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
if from_glib(f(
|
if from_glib(f(
|
||||||
element.unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
element.unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
pad.to_glib_none().0,
|
pad.to_glib_none().0,
|
||||||
decide_query.as_mut_ptr(),
|
decide_query
|
||||||
|
.as_ref()
|
||||||
|
.map(|q| q.as_mut_ptr())
|
||||||
|
.unwrap_or(ptr::null_mut()),
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
)) {
|
)) {
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -1176,9 +1179,13 @@ unsafe extern "C" fn aggregator_propose_allocation<T: AggregatorImpl>(
|
||||||
let instance = &*(ptr as *mut T::Instance);
|
let instance = &*(ptr as *mut T::Instance);
|
||||||
let imp = instance.impl_();
|
let imp = instance.impl_();
|
||||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||||
let decide_query = match gst::QueryRef::from_ptr(decide_query).view() {
|
let decide_query = if decide_query.is_null() {
|
||||||
gst::QueryView::Allocation(allocation) => allocation,
|
None
|
||||||
_ => unreachable!(),
|
} else {
|
||||||
|
match gst::QueryRef::from_ptr(decide_query).view() {
|
||||||
|
gst::QueryView::Allocation(allocation) => Some(allocation),
|
||||||
|
_ => unreachable!(),
|
||||||
|
}
|
||||||
};
|
};
|
||||||
let query = match gst::QueryRef::from_mut_ptr(query).view_mut() {
|
let query = match gst::QueryRef::from_mut_ptr(query).view_mut() {
|
||||||
gst::QueryView::Allocation(allocation) => allocation,
|
gst::QueryView::Allocation(allocation) => allocation,
|
||||||
|
|
|
@ -138,7 +138,7 @@ pub trait BaseTransformImpl: BaseTransformImplExt + ElementImpl {
|
||||||
fn propose_allocation(
|
fn propose_allocation(
|
||||||
&self,
|
&self,
|
||||||
element: &Self::Type,
|
element: &Self::Type,
|
||||||
decide_query: gst::query::Allocation<&gst::QueryRef>,
|
decide_query: Option<gst::query::Allocation<&gst::QueryRef>>,
|
||||||
query: gst::query::Allocation<&mut gst::QueryRef>,
|
query: gst::query::Allocation<&mut gst::QueryRef>,
|
||||||
) -> Result<(), gst::ErrorMessage> {
|
) -> Result<(), gst::ErrorMessage> {
|
||||||
self.parent_propose_allocation(element, decide_query, query)
|
self.parent_propose_allocation(element, decide_query, query)
|
||||||
|
@ -277,7 +277,7 @@ pub trait BaseTransformImplExt: ObjectSubclass {
|
||||||
fn parent_propose_allocation(
|
fn parent_propose_allocation(
|
||||||
&self,
|
&self,
|
||||||
element: &Self::Type,
|
element: &Self::Type,
|
||||||
decide_query: gst::query::Allocation<&gst::QueryRef>,
|
decide_query: Option<gst::query::Allocation<&gst::QueryRef>>,
|
||||||
query: gst::query::Allocation<&mut gst::QueryRef>,
|
query: gst::query::Allocation<&mut gst::QueryRef>,
|
||||||
) -> Result<(), gst::ErrorMessage>;
|
) -> Result<(), gst::ErrorMessage>;
|
||||||
|
|
||||||
|
@ -717,7 +717,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
fn parent_propose_allocation(
|
fn parent_propose_allocation(
|
||||||
&self,
|
&self,
|
||||||
element: &Self::Type,
|
element: &Self::Type,
|
||||||
decide_query: gst::query::Allocation<&gst::QueryRef>,
|
decide_query: Option<gst::query::Allocation<&gst::QueryRef>>,
|
||||||
query: gst::query::Allocation<&mut gst::QueryRef>,
|
query: gst::query::Allocation<&mut gst::QueryRef>,
|
||||||
) -> Result<(), gst::ErrorMessage> {
|
) -> Result<(), gst::ErrorMessage> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -728,7 +728,10 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(
|
if from_glib(f(
|
||||||
element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0,
|
element.unsafe_cast_ref::<BaseTransform>().to_glib_none().0,
|
||||||
decide_query.as_mut_ptr(),
|
decide_query
|
||||||
|
.as_ref()
|
||||||
|
.map(|q| q.as_mut_ptr())
|
||||||
|
.unwrap_or(ptr::null_mut()),
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
)) {
|
)) {
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -1327,9 +1330,13 @@ unsafe extern "C" fn base_transform_propose_allocation<T: BaseTransformImpl>(
|
||||||
let instance = &*(ptr as *mut T::Instance);
|
let instance = &*(ptr as *mut T::Instance);
|
||||||
let imp = instance.impl_();
|
let imp = instance.impl_();
|
||||||
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
|
let wrap: Borrowed<BaseTransform> = from_glib_borrow(ptr);
|
||||||
let decide_query = match gst::QueryRef::from_ptr(decide_query).view() {
|
let decide_query = if decide_query.is_null() {
|
||||||
gst::QueryView::Allocation(allocation) => allocation,
|
None
|
||||||
_ => unreachable!(),
|
} else {
|
||||||
|
match gst::QueryRef::from_ptr(decide_query).view() {
|
||||||
|
gst::QueryView::Allocation(allocation) => Some(allocation),
|
||||||
|
_ => unreachable!(),
|
||||||
|
}
|
||||||
};
|
};
|
||||||
let query = match gst::QueryRef::from_mut_ptr(query).view_mut() {
|
let query = match gst::QueryRef::from_mut_ptr(query).view_mut() {
|
||||||
gst::QueryView::Allocation(allocation) => allocation,
|
gst::QueryView::Allocation(allocation) => allocation,
|
||||||
|
|
Loading…
Reference in a new issue