Skip to content

Commit

Permalink
ndk/media: Add bindings for AMediaExtractor and AMediaDataSource
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Dec 2, 2023
1 parent 46d6ebb commit e92eae2
Show file tree
Hide file tree
Showing 3 changed files with 661 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ndk/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use std::{
ffi::{CStr, CString},
io,
ops::Range,
os::fd::{FromRawFd, OwnedFd},
ptr::NonNull,
};
Expand Down Expand Up @@ -321,3 +322,11 @@ pub struct OpenedFileDescriptor {
pub offset: usize,
pub size: usize,
}

impl OpenedFileDescriptor {
/// Returns a range starting at [`OpenedFileDescriptor::offset`] with a length of
/// [`OpenedFileDescriptor::size`].
pub fn range(&self) -> Range<usize> {
self.offset..(self.offset + self.size)
}
}
Loading

0 comments on commit e92eae2

Please sign in to comment.