common.go 625 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
  2. // SPDX-License-Identifier: MIT
  3. package codecs
  4. func min(a, b int) int {
  5. if a < b {
  6. return a
  7. }
  8. return b
  9. }
  10. // audioDepacketizer is a mixin for audio codec depacketizers
  11. type audioDepacketizer struct{}
  12. func (d *audioDepacketizer) IsPartitionTail(_ bool, _ []byte) bool {
  13. return true
  14. }
  15. func (d *audioDepacketizer) IsPartitionHead(_ []byte) bool {
  16. return true
  17. }
  18. // videoDepacketizer is a mixin for video codec depacketizers
  19. type videoDepacketizer struct{}
  20. func (d *videoDepacketizer) IsPartitionTail(marker bool, _ []byte) bool {
  21. return marker
  22. }