Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Add net module in lib_ccxr #1557

Closed
wants to merge 5 commits into from

Conversation

elbertronnie
Copy link
Contributor

@elbertronnie elbertronnie commented Aug 27, 2023

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.

This is an attempt to split #1495 into multiple independant PRs. Dependant on #1551, #1556 and #1553.

This PR adds networking primitives to send and receive captions across the internet. The networking functions are integrated into C codebase.

NOTE: I was able to test the TCP implementation but I could check if the UDP implementation is correct or not, since there is no way to send caption through UDP.

@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results:

Report Name Tests Passed
Broken 13/13
CEA-708 2/14
DVB 4/7
DVD 3/3
DVR-MS 2/2
General 24/27
Hauppage 3/3
MP4 2/3
NoCC 10/10
Options 72/87
Teletext 21/21
WTV 9/13
XDS 26/34

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Your PR breaks these cases:

  • ccextractor -autoprogram -out=srt -latin1 85271be4d2..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 1974a299f0..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 132d7df7e9..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 99e5eaafdc..., Last passed: Never
  • ccextractor -out=srt -latin1 f23a544ba8..., Last passed: Never
  • ccextractor -out=srt -latin1 97cc394d87..., Last passed: Never
  • ccextractor -out=srt -latin1 10f0f77cf4..., Last passed: Never
  • ccextractor -out=srt -latin1 df3b4d62d3..., Last passed: Never
  • ccextractor -autoprogram -out=smptett -latin1 -ucla e274a73653..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -xds -latin1 -ucla e274a73653..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 -ucla -xds b22260d065..., Last passed: Never
  • ccextractor -autoprogram -out=srt -latin1 -ucla b22260d065..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 -xds -ucla c813e713a0..., Last passed: Never
  • ccextractor -autoprogram -out=srt -latin1 -ucla c813e713a0..., Last passed: Never
  • ccextractor -autoprogram -out=srt -latin1 -ucla c8dc039a88..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 -ucla -xds 88cd42b89a..., Last passed: Never
  • ccextractor -svc 1 -out=txt -nobom -noru ea83ff7bcb..., Last passed: Never
  • ccextractor -svc 1 -out=txt f17524b53f..., Last passed: Never
  • ccextractor -svc 1 -out=txt 80848c45f8..., Last passed: Never
  • ccextractor -svc 1 -out=txt -nobom -noru b5d6aad89f..., Last passed: Never
  • ccextractor -svc 1[EUC-KR] -out=txt -noru b5d6aad89f..., Last passed: Never
  • ccextractor -svc 1 -out=srt da904de35d..., Last passed: Never
  • ccextractor -svc 1 -out=sami da904de35d..., Last passed: Never
  • ccextractor -svc 1[EUC-KR] b5d6aad89f..., Last passed: Never
  • ccextractor -svc 1[EUC-KR] -noru b5d6aad89f..., Last passed: Never
  • ccextractor -svc all da904de35d..., Last passed: Never
  • ccextractor -svc all[EUC-KR] b5d6aad89f..., Last passed: Never
  • ccextractor -svc 1,2[UTF-8],3[EUC-KR],54 -out=txt da904de35d..., Last passed: Never
  • ccextractor -autoprogram -out=srt -latin1 -1 a65d39ccb3..., Last passed: Never
  • ccextractor -svc 1 c83f765c66..., Last passed: Never
  • ccextractor -out=spupng c83f765c66..., Last passed: Never
  • ccextractor -nogt c83f765c66..., Last passed: Never
  • ccextractor --fixpadding c83f765c66..., Last passed: Never
  • ccextractor --capfile /repository/Dictionary/MattS_dictionary.txt c83f765c66..., Last passed: Never
  • ccextractor -bi c83f765c66..., Last passed: Never
  • ccextractor -nobi c83f765c66..., Last passed: Never
  • ccextractor -bs 1M c83f765c66..., Last passed: Never
  • ccextractor -ru2 c83f765c66..., Last passed: Never
  • ccextractor -ru3 c83f765c66..., Last passed: Never
  • ccextractor -debug -out=srt c83f765c66..., Last passed: Never
  • ccextractor -608 -out=srt c83f765c66..., Last passed: Never
  • ccextractor -parsePAT -out=srt c83f765c66..., Last passed: Never
  • ccextractor -in=es dc7169d7c4..., Last passed: Never
  • ccextractor -autoprogram -out=srt -bom -latin1 8849331dda..., Last passed: Never
  • ccextractor -stdout -quiet -nofc 79a51f3500..., Last passed: Never
  • ccextractor -stdout -quiet -nofc 767b546f96..., Last passed: Never

Check the result page for more info.

@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results:

Report Name Tests Passed
Broken 13/13
CEA-708 2/14
DVB 4/7
DVD 3/3
DVR-MS 2/2
General 24/27
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 85/87
Teletext 21/21
WTV 13/13
XDS 30/34

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Your PR breaks these cases:

  • ccextractor -autoprogram -out=srt -latin1 85271be4d2..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 1974a299f0..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 132d7df7e9..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 99e5eaafdc..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -xds -latin1 -ucla e274a73653..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 -ucla -xds b22260d065..., Last passed: Never
  • ccextractor -autoprogram -out=srt -latin1 -ucla c8dc039a88..., Last passed: Never
  • ccextractor -autoprogram -out=ttxt -latin1 -ucla -xds 88cd42b89a..., Last passed: Never
  • ccextractor -svc 1 -out=txt -nobom -noru ea83ff7bcb..., Last passed: Never
  • ccextractor -svc 1 -out=txt f17524b53f..., Last passed: Never
  • ccextractor -svc 1 -out=txt 80848c45f8..., Last passed: Never
  • ccextractor -svc 1 -out=txt -nobom -noru b5d6aad89f..., Last passed: Never
  • ccextractor -svc 1[EUC-KR] -out=txt -noru b5d6aad89f..., Last passed: Never
  • ccextractor -svc 1 -out=srt da904de35d..., Last passed: Never
  • ccextractor -svc 1 -out=sami da904de35d..., Last passed: Never
  • ccextractor -svc 1[EUC-KR] b5d6aad89f..., Last passed: Never
  • ccextractor -svc 1[EUC-KR] -noru b5d6aad89f..., Last passed: Never
  • ccextractor -svc all da904de35d..., Last passed: Never
  • ccextractor -svc all[EUC-KR] b5d6aad89f..., Last passed: Never
  • ccextractor -svc 1,2[UTF-8],3[EUC-KR],54 -out=txt da904de35d..., Last passed: Never
  • ccextractor -svc 1 c83f765c66..., Last passed: Never
  • ccextractor --capfile /repository/Dictionary/MattS_dictionary.txt c83f765c66..., Last passed: Never
  • ccextractor -stdout -quiet -nofc 79a51f3500..., Last passed: Never
  • ccextractor -stdout -quiet -nofc 767b546f96..., Last passed: Never

Check the result page for more info.

let mut data = Vec::with_capacity(total_len);

data.extend_from_slice(start.as_bytes());
data.extend_from_slice("\0".as_bytes());
Copy link
Contributor

@IshanGrover2004 IshanGrover2004 Aug 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data.extend_from_slice("\0".as_bytes());

Is this necessary?? @elbertronnie

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this because C code uses memcpy. But still is this really needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t = 1;
if (title != NULL)
    t += strlen(title);

// ------- other code -------

if (title != NULL)
    memcpy(end, title, t);
end += t;

Yes, because memcpy will also also copy the NUL character. This is necessary, otherwise how will the program know where one string starts and other ends. You are not passing the length of each string anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I was busy for the past week, I will probably review both your PRs tomorrow or day after tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants