Wireshark-dev: Re: [Wireshark-dev] Support Opus in WireShark
From: Graham Bloice <graham.bloice@xxxxxxxxxxxxx>
Date: Sun, 19 Jan 2020 10:36:15 +0000
Hi Ryan,

Thanks for your email and suggested contributions, some general development comments:

For info on the workflow on submitting changes to wireshark, see the Wiki pages on Creating patches (https://wiki.wireshark.org/CreatingPatches) and Submitting patches (https://wiki.wireshark.org/Development/SubmittingPatches)..

All current codecs are in C, not C++.  There is a convention, based on portability concerns, that all dissector "engine" code is in C.  There would need to be a discussion about introducing C++ code into this area.


On Sun, 19 Jan 2020 at 07:08, <ryanlee@xxxxxxxxxxxxxxxx> wrote:
Hello everyone

Because Opus is a totally open audio codec and very useful, I want to make WireShark support Opus so that the WireShark can play Opus audio RTP stream and save. I had some attempts. Put the Opus into the plugins/codecs. Now WireShark can play and save Opus audio RTP stream like the g711, g722. To support Opus and FEC(Forward Error Correction), I changed some code

Here is the change:
1、Change a function with C++ default parameters 
	Origin version:   size_t convert_payload_to_samples(unsigned int payload_type, QTemporaryFile *tempfile, uint8_t *pd_out, size_t expected_nchars, struct _GHashTable *decoders_hash ); 
     MyChanged version:  size_t convert_payload_to_samples(unsigned int payload_type, QTemporaryFile *tempfile, uint8_t *pd_out, size_t expected_nchars, struct _GHashTable *decoders_hash , size_t fecflag = 0);
2、Add some codes to support OPus fec、play and save.In my opinion these codes don't affect other functions.(In the files: rtp_audio_stream.cpp   rtp_audio_stream.cpp )

I don't know whether the change is useful and meets specifications.

The other question:  In the RTP protocol, Opus don't have a fixed payload type.  Now I write the payload type into macro. Does it have a good way to let user choose the Opus payload type? Although tried ,I failed~~ I don't know how to realize it. 

It is my first time to participate in a open source project. And I want to make a contribution. I don't know whether it is a good way to plugin Opus into WireShark or not. If  not , is there a better way?  I want to know and try it!  

    Best regards,

    Ryan Lee


--
Graham Bloice