Creating custom GStreamer Plugin that converts GRAY8 to NV12 data

Also looks like this is a duplicate of Hello, I am creating a new custom gstreamer plugin for format conversion from GRAY8 to NV12. I have set the caps on src and sink pad. But the plugin is not being linked due to incompatible caps. Can someone help me out in fixing this?