Files
lkm/stream/memory_pool.go
DESKTOP-COJOJSE\lenovo 33ec8159f1 完善Source和Sink
2023-11-18 17:57:05 +08:00

30 lines
507 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package stream
// MemoryPool
// 从解复用阶段拼凑成完整的AVPacket开始(写)到GOP缓存结束(释放),整个过程都使用池中内存
type MemoryPool interface {
Allocate(size int) []byte
Free(size int)
}
func NewMemoryPool(capacity int) MemoryPool {
pool := &memoryPool{
data: make([]byte, capacity),
}
return pool
}
type memoryPool struct {
data []byte
size int
}
func (m *memoryPool) Allocate(size int) []byte {
return nil
}
func (m *memoryPool) Free(size int) {
}