Fix compilation
Push protobuf handling to codec class