[PR #1443] [MERGED] Port hardsubx utility #2188

Open
opened 2026-01-29 17:20:44 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1443
Author: @shashwat1002
Created: 6/22/2022
Status: Merged
Merged: 7/13/2022
Merged by: @PunitLodha

Base: masterHead: port_hardsubx_utility


📝 Commits (10+)

  • 5e2caf2 set up bindings conversion of hardsubx utility functions (and structs) and set up the module
  • 4043e5e add low level ffmpeg rust binding
  • 4a57f0f Methods ported:
  • 736a8f7 put C code of hardsubx_utility under define rust flag
  • 4c380d3 run formatter
  • c9a0feb make compilation of hardsubx rust modules conditional on the HARDSUBX and the OCR flags. Make ffmpeg a conditional dependency based on those flags
  • 04515c7 remove namespaced dependency in cargo because that is a nightly feature
  • 174dbd8 add conditioal compilatio of ffmpeg related bindigs in build.rs
  • ce7b1ff make clang argument of -DENABLE_HARDSUBX conditional on cargo feature of hardsubx_ocr
  • 068dec0 enable specific relevant features for ffmpeg-sys-next

📊 Changes

15 files changed (+280 additions, -58 deletions)

View changed files

📝 .github/workflows/build_linux.yml (+1 -1)
📝 .github/workflows/format.yml (+3 -1)
📝 linux/Makefile.am (+20 -16)
📝 linux/build (+7 -1)
📝 mac/Makefile.am (+21 -16)
📝 src/lib_ccx/hardsubx_utility.c (+1 -1)
📝 src/rust/CMakeLists.txt (+10 -2)
📝 src/rust/Cargo.lock (+90 -3)
📝 src/rust/Cargo.toml (+5 -1)
📝 src/rust/build.rs (+29 -14)
📝 src/rust/src/hardsubx/mod.rs (+1 -0)
src/rust/src/hardsubx/utility.rs (+88 -0)
📝 src/rust/src/lib.rs (+1 -0)
📝 src/rust/wrapper.h (+2 -1)
📝 windows/rustx86.bat (+1 -1)

📄 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.

Ported hardsubx_utility

added pure rust function for levenstein edit distance
added a wrapper for compatibility with C code. The wrapper won't be necessary when the downstream modules are ported.

PS: some methods in the original C code were never used anywhere and therefore they were not ported

CC: @PunitLodha


🔄 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/1443 **Author:** [@shashwat1002](https://github.com/shashwat1002) **Created:** 6/22/2022 **Status:** ✅ Merged **Merged:** 7/13/2022 **Merged by:** [@PunitLodha](https://github.com/PunitLodha) **Base:** `master` ← **Head:** `port_hardsubx_utility` --- ### 📝 Commits (10+) - [`5e2caf2`](https://github.com/CCExtractor/ccextractor/commit/5e2caf239762e48d1b4f18de24c3f14863366442) set up bindings conversion of hardsubx utility functions (and structs) and set up the module - [`4043e5e`](https://github.com/CCExtractor/ccextractor/commit/4043e5e72244af362d2c7065612ea53e1ecd50b1) add low level ffmpeg rust binding - [`4a57f0f`](https://github.com/CCExtractor/ccextractor/commit/4a57f0f8b64576d1ba08939aca13fc4b9999080a) Methods ported: - [`736a8f7`](https://github.com/CCExtractor/ccextractor/commit/736a8f7b9cf0f44ddaa8764b3d77de04c578bb81) put C code of hardsubx_utility under define rust flag - [`4c380d3`](https://github.com/CCExtractor/ccextractor/commit/4c380d39227ec59ad2d56c73cdeda55abe62b05c) run formatter - [`c9a0feb`](https://github.com/CCExtractor/ccextractor/commit/c9a0feb9b7a8f97b723a6e975f08759c2f06c7de) make compilation of hardsubx rust modules conditional on the HARDSUBX and the OCR flags. Make ffmpeg a conditional dependency based on those flags - [`04515c7`](https://github.com/CCExtractor/ccextractor/commit/04515c711e4a82ba97b116bb3eab0231376c5736) remove namespaced dependency in cargo because that is a nightly feature - [`174dbd8`](https://github.com/CCExtractor/ccextractor/commit/174dbd8d9534d6f9c6a066681cb7143dc008e30f) add conditioal compilatio of ffmpeg related bindigs in build.rs - [`ce7b1ff`](https://github.com/CCExtractor/ccextractor/commit/ce7b1ffdc03d4ae757ed01e5c8d09ce904a82a24) make clang argument of -DENABLE_HARDSUBX conditional on cargo feature of hardsubx_ocr - [`068dec0`](https://github.com/CCExtractor/ccextractor/commit/068dec072bb5d2cd0db02ff14009531ab49ef002) enable specific relevant features for ffmpeg-sys-next ### 📊 Changes **15 files changed** (+280 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build_linux.yml` (+1 -1) 📝 `.github/workflows/format.yml` (+3 -1) 📝 `linux/Makefile.am` (+20 -16) 📝 `linux/build` (+7 -1) 📝 `mac/Makefile.am` (+21 -16) 📝 `src/lib_ccx/hardsubx_utility.c` (+1 -1) 📝 `src/rust/CMakeLists.txt` (+10 -2) 📝 `src/rust/Cargo.lock` (+90 -3) 📝 `src/rust/Cargo.toml` (+5 -1) 📝 `src/rust/build.rs` (+29 -14) 📝 `src/rust/src/hardsubx/mod.rs` (+1 -0) ➕ `src/rust/src/hardsubx/utility.rs` (+88 -0) 📝 `src/rust/src/lib.rs` (+1 -0) 📝 `src/rust/wrapper.h` (+2 -1) 📝 `windows/rustx86.bat` (+1 -1) </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):** - [ ] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [ ] 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](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. --- Ported `hardsubx_utility` added pure rust function for levenstein edit distance added a wrapper for compatibility with C code. The wrapper won't be necessary when the downstream modules are ported. PS: some methods in the original C code were never used anywhere and therefore they were not ported CC: @PunitLodha --- <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:20:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2188