// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE*
5430
func (f genHelperEncoder) Extension(rtid uintptr) (xfn *extTypeTagFn) {
	return f.e.h.getExt(rtid)
}
714165
func DefaultJSONEncoder() runtime.Encoder {
	return unstructured.JSONFallbackEncoder{Encoder: Codecs.LegacyCodec(Scheme.PrioritizedVersionsAllGroups()...)}
}
1295428
func (md *RootMetadata) AddKeyGeneration(codec kbfscodec.Codec,
	wKeys, rKeys kbfsmd.UserDevicePublicKeys,
	ePubKey kbfscrypto.TLFEphemeralPublicKey,
	ePrivKey kbfscrypto.TLFEphemeralPrivateKey,
	pubKey kbfscrypto.TLFPublicKey,
	privKey kbfscrypto.TLFPrivateKey,
	currCryptKey, nextCryptKey kbfscrypto.TLFCryptKey) (
	serverHalves kbfsmd.UserDeviceKeyServerHalves, err error) {
	nextExtra, serverHalves, err := md.bareMd.AddKeyGeneration(
		codec, md.extra, wKeys, rKeys, ePubKey, ePrivKey,
		pubKey, currCryptKey, nextCryptKey)
	if err != nil {
		return nil, err
	}
	md.extra = nextExtra
	md.data.TLFPrivateKey = privKey
	return serverHalves, nil
}
1136909
func (l *Live) DeleteLiveStreamTranscode(template string, resp interface{}) (err error) {
	req := l.cloneRequest(DeleteLiveStreamTranscodeAction)
	req.SetArgs("Domain", req.DomainName)
	req.SetArgs("App", req.AppName)
	req.SetArgs("Template", template)
	err = l.rpc.Query(req, resp)
	return
}
423778
func NewCodec(conn Conn, encode, decode func(v interface{}) error) ServerCodec {
	codec := &jsonCodec{
		closed: make(chan interface{}),
		encode: encode,
		decode: decode,
		conn:   conn,
	}
	if ra, ok := conn.(ConnRemoteAddr); ok {
		codec.remoteAddr = ra.RemoteAddr()
	}
	return codec
}
640869
func (v *RPC) GetEncoding() (o string) {
	if v != nil {
		o = v.Encoding
	}
	return
}
894226
func makePtrDecoder(typ reflect.Type) (decoder, error) {
	etype := typ.Elem()
	etypeinfo, err := cachedTypeInfo1(etype, tags{})
	if err != nil {
		return nil, err
	}
	dec := func(s *Stream, val reflect.Value) (err error) {
		newval := val
		if val.IsNil() {
			newval = reflect.New(etype)
		}
		if err = etypeinfo.decoder(s, newval.Elem()); err == nil {
			val.Set(newval)
		}
		return err
	}
	return dec, nil
}
622149
func (c *codec) EncodeToStream(obj runtime.Object, w io.Writer, overrides ...unversioned.GroupVersion) error {
	if _, ok := obj.(*runtime.Unknown); ok {
		return c.serializer.EncodeToStream(obj, w, overrides...)
	}
	gvk, isUnversioned, err := c.typer.ObjectKind(obj)
	if err != nil {
		return err
	}

	if (c.encodeVersion == nil && len(overrides) == 0) || isUnversioned {
		old := obj.GetObjectKind().GroupVersionKind()
		obj.GetObjectKind().SetGroupVersionKind(gvk)
		defer obj.GetObjectKind().SetGroupVersionKind(old)
		return c.serializer.EncodeToStream(obj, w, overrides...)
	}

	targetGV, ok := c.encodeVersion[gvk.Group]
	// use override if provided
	for i, override := range overrides {
		if override.Group == gvk.Group {
			ok = true
			targetGV = override
			// swap the position of the override
			overrides[0], overrides[i] = targetGV, overrides[0]
			break
		}
	}

	// attempt a conversion to the sole encode version
	if !ok && len(c.encodeVersion) == 1 {
		ok = true
		for _, v := range c.encodeVersion {
			targetGV = v
		}
		// ensure the target override is first
		overrides = promoteOrPrependGroupVersion(targetGV, overrides)
	}

	// if no fallback is available, error
	if !ok {
		return fmt.Errorf("the codec does not recognize group %q for kind %q and cannot encode it", gvk.Group, gvk.Kind)
	}

	// Perform a conversion if necessary
	if gvk.GroupVersion() != targetGV {
		out, err := c.convertor.ConvertToVersion(obj, targetGV.String())
		if err != nil {
			if ok {
				return err
			}
		} else {
			obj = out
		}
	} else {
		old := obj.GetObjectKind().GroupVersionKind()
		defer obj.GetObjectKind().SetGroupVersionKind(old)
		obj.GetObjectKind().SetGroupVersionKind(&unversioned.GroupVersionKind{Group: targetGV.Group, Version: targetGV.Version, Kind: gvk.Kind})
	}

	return c.serializer.EncodeToStream(obj, w, overrides...)
}
465335
func (m *MediaType) Encoder(w io.Writer) (Encoder, error) {
	if encfunc, ok := encoders[m.Format]; ok {
		return encfunc(w), nil
	}
	return nil, fmt.Errorf("No encoder found for format %s (%s)", m.Format, m.String())
}
1085612
func (f CodecFactory) SerializerForMediaType(mediaType string, options map[string]string) (runtime.Serializer, bool) {
	for _, s := range f.serializers {
		for _, accepted := range s.AcceptContentTypes {
			if accepted == mediaType {
				if v, ok := options["pretty"]; ok && v == "1" && s.PrettySerializer != nil {
					return s.PrettySerializer, true
				}
				return s.Serializer, true
			}
		}
	}
	return nil, false
}
1072829
func (f CodecFactory) EncoderForVersion(serializer runtime.Serializer, gv unversioned.GroupVersion) runtime.Encoder {
	return f.CodecForVersions(serializer, []unversioned.GroupVersion{gv}, nil)
}
1056762
func (s *VideoCodecSettings) SetCodec(v string) *VideoCodecSettings {
	s.Codec = &v
	return s
}
424337
func (s *AudioParameters) SetCodec(v string) *AudioParameters {
	s.Codec = &v
	return s
}
973918
func (s *Server) getCodec(contentSubtype string) baseCodec {
	if s.opts.codec != nil {
		return s.opts.codec
	}
	if contentSubtype == "" {
		return encoding.GetCodec(proto.Name)
	}
	codec := encoding.GetCodec(contentSubtype)
	if codec == nil {
		return encoding.GetCodec(proto.Name)
	}
	return codec
}
1185174
func (pdu *codec) init() {
	if pdu.l == nil {
		pdu.l = pdufield.List{}
	}
	pdu.f = make(pdufield.Map)
	pdu.t = make(pdutlv.Map)
	if pdu.h.Seq == 0 { // If Seq not set
		pdu.h.Seq = atomic.AddUint32(&nextSeq, 1)
	}
}
705239
func (codec *SyncCodec) Decode(in *ByteBuf) (bool, interface{}, error) {
	cmd, _ := in.ReadByte()
	if cmd == cmdNotify {
		value := acquireNotify()
		value.offset, _ = in.ReadUInt64()
		return true, value, nil
	} else if cmd == cmdNotifySync {
		value := acquireNotifySync()
		value.offset, _ = in.ReadUInt64()
		return true, value, nil
	} else if cmd == cmdNotifySyncRsp {
		value := acquireNotifySyncRsp()
		value.offset, _ = in.ReadUInt64()
		value.count, _ = in.ReadByte()
		value.buf.Write(in.GetMarkedRemindData())
		in.MarkedBytesReaded()
		return true, value, nil
	} else if cmd == cmdNotifyRaw {
		value := acquireNotifyRaw()
		value.buf.Write(in.GetMarkedRemindData())
		in.MarkedBytesReaded()
		return true, value, nil
	} else if cmd == cmdNotifyHB {
		value := &notifyHB{}
		value.offset, _ = in.ReadUInt64()
		return true, value, nil
	}

	return false, nil, nil
}
48204
func (c *ConfigLocal) SetCodec(co kbfscodec.Codec) {
	c.lock.Lock()
	defer c.lock.Unlock()
	c.codec = co
	RegisterOps(c.codec)
}