[PR #1662] [MERGED] [FEAT] added demuxer and file_functions module #2368

Closed
opened 2026-01-29 17:21:47 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1662
Author: @steel-bucket
Created: 2/11/2025
Status: Merged
Merged: 12/8/2025
Merged by: @prateekmedia

Base: masterHead: migration-demuxer-module


📝 Commits (10+)

  • 1bae1a8 feat: added demuxer module
  • a1dc67e Cargo Lock Update
  • 26aba5e Completed file_functions and demuxer
  • 7718d7b Completed file_functions and demuxer
  • 9ad0e05 written extern functions for demuxer
  • 63da17f Removed libc completely, added tests for gxf and ported gxf to C
  • 6bc2607 Hardsubx error fixed
  • 985a188 Fixing format issues
  • 1cbe989 clippy errors fixed
  • 7e15406 fixing format issues

📊 Changes

35 files changed (+7885 additions, -808 deletions)

View changed files

📝 docs/CHANGES.TXT (+1 -0)
📝 src/lib_ccx/ccx_demuxer.c (+35 -1)
📝 src/lib_ccx/ccx_demuxer_mxf.c (+0 -24)
📝 src/lib_ccx/ccx_demuxer_mxf.h (+27 -2)
📝 src/lib_ccx/ccx_gxf.c (+0 -299)
📝 src/lib_ccx/ccx_gxf.h (+298 -0)
📝 src/lib_ccx/es_functions.c (+16 -6)
📝 src/rust/Cargo.lock (+474 -193)
📝 src/rust/Cargo.toml (+7 -2)
📝 src/rust/build.rs (+16 -0)
📝 src/rust/lib_ccxr/src/activity.rs (+29 -2)
📝 src/rust/lib_ccxr/src/common/constants.rs (+17 -1)
📝 src/rust/src/avc/common_types.rs (+0 -107)
📝 src/rust/src/avc/core.rs (+1 -1)
📝 src/rust/src/avc/mod.rs (+0 -50)
📝 src/rust/src/common.rs (+478 -7)
src/rust/src/ctorust.rs (+845 -0)
src/rust/src/demuxer/common_types.rs (+326 -0)
src/rust/src/demuxer/demux.rs (+717 -0)
src/rust/src/demuxer/demuxer_data.rs (+41 -0)

...and 15 more files

📄 Description

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor(2 previous contributions).

In this PR, I have attempted to port the large demuxer module to Rust, the primary logic of the heavily interconnected C libraries file_functions.c and, ccx_demuxer.c and their corresponding header files has aleady been implemented here.
This PR was inspired by the ones done for the 708 Decoder in CCextractor.
The part of the codebase that the demuxer part of this PR migrates to Rust is the part that Opens a File(ccx_demuxer_open), points the codebase towards that file, detects the stream type and some other parameters like myth, and then closes the file or gets the file size.
The file_functions part of this PR is tested locally, and in unit tests, but integrating it into C made the codebase really slow, due to the constant copying back and forth C and Rust, so it was left to be used in future Rust Libraries like MythTV, MXF, GXF, etc.
Any criticism or suggestion is wholeheartedly welcome.

  • It is built and ready to be reviewed now.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1662 **Author:** [@steel-bucket](https://github.com/steel-bucket) **Created:** 2/11/2025 **Status:** ✅ Merged **Merged:** 12/8/2025 **Merged by:** [@prateekmedia](https://github.com/prateekmedia) **Base:** `master` ← **Head:** `migration-demuxer-module` --- ### 📝 Commits (10+) - [`1bae1a8`](https://github.com/CCExtractor/ccextractor/commit/1bae1a883a94dd81a0e14082fe5088d2009a0d99) feat: added demuxer module - [`a1dc67e`](https://github.com/CCExtractor/ccextractor/commit/a1dc67edad6dab8ff8344f4e93c4b2f5d464d3dc) Cargo Lock Update - [`26aba5e`](https://github.com/CCExtractor/ccextractor/commit/26aba5e44040ad2fda23549ab84cd19774d4fd66) Completed file_functions and demuxer - [`7718d7b`](https://github.com/CCExtractor/ccextractor/commit/7718d7b209c4a7809773624b157d9dc7f9df6e75) Completed file_functions and demuxer - [`9ad0e05`](https://github.com/CCExtractor/ccextractor/commit/9ad0e050564a637dfe55012a6cacccb6c6dd8bf0) written extern functions for demuxer - [`63da17f`](https://github.com/CCExtractor/ccextractor/commit/63da17fcf350d0f6a2b3d01fe9c6d8e8fb9f7ad4) Removed libc completely, added tests for gxf and ported gxf to C - [`6bc2607`](https://github.com/CCExtractor/ccextractor/commit/6bc26074cfa5bbfeb004480746e90997f6a2a2f2) Hardsubx error fixed - [`985a188`](https://github.com/CCExtractor/ccextractor/commit/985a188e1d84e0506dd75b278dafcd5d8aaa916e) Fixing format issues - [`1cbe989`](https://github.com/CCExtractor/ccextractor/commit/1cbe989a5c7d30cb397df8f193c6f3be1425d1c9) clippy errors fixed - [`7e15406`](https://github.com/CCExtractor/ccextractor/commit/7e1540685e38236413d471ab74821b2ce4a2645d) fixing format issues ### 📊 Changes **35 files changed** (+7885 additions, -808 deletions) <details> <summary>View changed files</summary> 📝 `docs/CHANGES.TXT` (+1 -0) 📝 `src/lib_ccx/ccx_demuxer.c` (+35 -1) 📝 `src/lib_ccx/ccx_demuxer_mxf.c` (+0 -24) 📝 `src/lib_ccx/ccx_demuxer_mxf.h` (+27 -2) 📝 `src/lib_ccx/ccx_gxf.c` (+0 -299) 📝 `src/lib_ccx/ccx_gxf.h` (+298 -0) 📝 `src/lib_ccx/es_functions.c` (+16 -6) 📝 `src/rust/Cargo.lock` (+474 -193) 📝 `src/rust/Cargo.toml` (+7 -2) 📝 `src/rust/build.rs` (+16 -0) 📝 `src/rust/lib_ccxr/src/activity.rs` (+29 -2) 📝 `src/rust/lib_ccxr/src/common/constants.rs` (+17 -1) 📝 `src/rust/src/avc/common_types.rs` (+0 -107) 📝 `src/rust/src/avc/core.rs` (+1 -1) 📝 `src/rust/src/avc/mod.rs` (+0 -50) 📝 `src/rust/src/common.rs` (+478 -7) ➕ `src/rust/src/ctorust.rs` (+845 -0) ➕ `src/rust/src/demuxer/common_types.rs` (+326 -0) ➕ `src/rust/src/demuxer/demux.rs` (+717 -0) ➕ `src/rust/src/demuxer/demuxer_data.rs` (+41 -0) _...and 15 more files_ </details> ### 📄 Description <!-- Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**. --> **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. - [x] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [ ] I have never used CCExtractor. - [ ] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [x] I am an active contributor to CCExtractor(2 previous contributions). --- In this PR, I have attempted to port the large `demuxer` module to Rust, the primary logic of the heavily interconnected C libraries `file_functions.c` and, `ccx_demuxer.c` and their corresponding header files has aleady been implemented here. This PR was inspired by the ones done for the 708 Decoder in CCextractor. The part of the codebase that the demuxer part of this PR migrates to Rust is the part that Opens a File(ccx_demuxer_open), points the codebase towards that file, detects the stream type and some other parameters like myth, and then closes the file or gets the file size. The file_functions part of this PR is tested locally, and in unit tests, but integrating it into C made the codebase really slow, due to the constant copying back and forth C and Rust, so it was left to be used in future Rust Libraries like MythTV, MXF, GXF, etc. Any criticism or suggestion is wholeheartedly welcome. - It is built and ready to be reviewed now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:21:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2368