panicbit / rust-av

Other
14 stars 1 forks source link

Make Frame and Packet sendable across threads #28

Closed panicbit closed 7 years ago

panicbit commented 7 years ago

Though not explicitly stated by the AVFrame and AVPacket doc, these types make use of the AVBuffer API and should thus be thread-safe:

Note: Referencing and unreferencing the buffers is thread-safe and thus may be done from multiple threads simultaneously without any need for additional locking. Two different references to the same buffer can point to different parts of the buffer (i.e. their AVBufferRef.data will not be equal).

It should be safe to implement Send and Sync for Frame and Packet.