mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
chore(codec/context): use dyn Any over dyn Drop to silence mem::needs_drop warning
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::{ptr, rc::Rc};
|
||||
use std::{any::Any, ptr, rc::Rc};
|
||||
|
||||
use libc::c_int;
|
||||
|
||||
@@ -9,13 +9,13 @@ use crate::{ffi::*, media, Codec, Error, Rational};
|
||||
|
||||
pub struct Context {
|
||||
ptr: *mut AVCodecContext,
|
||||
owner: Option<Rc<dyn Drop>>,
|
||||
owner: Option<Rc<dyn Any>>,
|
||||
}
|
||||
|
||||
unsafe impl Send for Context {}
|
||||
|
||||
impl Context {
|
||||
pub unsafe fn wrap(ptr: *mut AVCodecContext, owner: Option<Rc<dyn Drop>>) -> Self {
|
||||
pub unsafe fn wrap(ptr: *mut AVCodecContext, owner: Option<Rc<dyn Any>>) -> Self {
|
||||
Context { ptr, owner }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
use std::rc::Rc;
|
||||
use std::{any::Any, ops::Deref, rc::Rc};
|
||||
|
||||
use super::{Context, Id};
|
||||
use crate::{ffi::*, media};
|
||||
|
||||
pub struct Parameters {
|
||||
ptr: *mut AVCodecParameters,
|
||||
owner: Option<Rc<dyn Drop>>,
|
||||
owner: Option<Rc<dyn Any>>,
|
||||
}
|
||||
|
||||
unsafe impl Send for Parameters {}
|
||||
|
||||
impl Parameters {
|
||||
pub unsafe fn wrap(ptr: *mut AVCodecParameters, owner: Option<Rc<dyn Drop>>) -> Self {
|
||||
pub unsafe fn wrap(ptr: *mut AVCodecParameters, owner: Option<Rc<dyn Any>>) -> Self {
|
||||
Parameters { ptr, owner }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user